Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Format number in Struts 2 <s:property/> tag

Tags:

java

struts2

ognl

I would like to format number displayed by <s:property value="summary.total"/> tag in Struts 2. There is a double value. How can I do that? Should I use OGNL?

Or maybe I must use <s:text/> tag and define my format in resuource file?

like image 255
prostynick Avatar asked Oct 13 '09 07:10

prostynick


1 Answers

The way more fast

<s:property value="getText('{0,number,#,##0.00}',{summary.total})"/>

Lucky!!

like image 146
Juanmi Avatar answered Sep 22 '22 14:09

Juanmi