Format number in Struts 2 <s:property/> tag
The way more fast
<s:property value="getText('{0,number,#,##0.00}',{summary.total})"/>
Lucky!!
You need to use <s:text/>
with <s:param/>
.
Property file:
summary.cost= € {0,number,##0.00}
JSP:
<s:text name="summary.cost">
<s:param name="value" value="summary.total"/>
</s:text>
This answer explains how to use #
and 0
in the format mask.
This one is quicker:
<s:property value="getText('struts.money.format', {summary.cost})" />
And in your properties file this:
struts.money.format= {0,number,\u00A4##0.00}
Hope this help