struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From musom...@aol.com
Subject Re: Formatting in extended theme using Freemarker
Date Sat, 12 Sep 2009 19:16:06 GMT

 Try the pattern "#.00".


 


Chris

 


 

-----Original Message-----
From: ashwin ala <ashwinala@gmail.com>
To: user@struts.apache.org
Sent: Sat, Sep 12, 2009 2:30 pm
Subject: RE: Formatting in extended theme using Freemarker










Thank you for the prompt replies.
The BigDecimal rounding somehow always renders the value with extra zeroes
appended.
I had some success with the freemarker number formatting as suggested by
Martin and am getting close to solving this. I changed text.ftl to now use
this line:
<#if parameters.nameValue??><#setting number_format="#.00">
 value="<@s.property value="${parameters.nameValue?number}"/>"<#rt/>
</#if>

However it still doesnt render the final 0. For example value "5" should
render as "5.00" but renders as "5.0"  Ive tried number_format="#.##" as
well as other combinations with no success.

I'll keep trying different approaches. Please let me know if you can suggest
a solution.

thanks
ash.



 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message