formating numeric string from variable

lcp <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
I am using Freemarker for a content.ftl file with Geoserver to be displayed
in OpenLayers.

I am not able to format my numeric values as strings. I can copy and paste
the examples from the freemarker FAQ page into my script and they do work.
These values are coming from a PostGIS database and are "numeric". 

Could someone please tell me what they think I am doing wrong? I gave some
examples of code I have tried.

This is part of the error I get:
Expected method. x?string evaluated instead to
freemarker.template.SimpleScalar on line 17, column 3 in content.ftl. The
problematic instruction: ---------- ==> ${x?string("0")} [on line 17, column
1 in content.ftl] ---------- Java backtrace for programmers: ----------
freemarker.template.TemplateException: Expected method. x?string evaluated
instead to freemarker.template.SimpleScalar on line 17, column 3 in
content.ftl. at...

Thank you, LP

DOESN'T WORK
<#if attribute.name = "last">
      <li>% of people living on less than $1 per day PPP - most recent
measurement of this indicator between 2002 and
2007:${attribute.value?string.currency}</li>
   </#if>
  </#list>
-----------------
DOESN'T WORK
${attribute.value?string(",##0.00")}</li>
-----------------
DOESN'T WORK
${attribute.value}</li>
<#assign x = attribute.value>
${x?string("0")}
------------------
DOES WORK

${attribute.value}</li>
 <#assign x = attribute.value>
${x?string}  <#-- the same as ${x} -->
------------------
DOES WORK

${attribute.value}</li>
<#assign x = 1.234>
${x?string("0")}
-----------------

-- 
View this message in context: http://n4.nabble.com/formating-numeric-string-from-variable-tp1012376p1012376.html
Sent from the freemarker-user mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.