Or, you can use the s:text tag (assuming you are using struts 2) and:

<s:text name="format.decimal">
 <s:param name="value" value="decimalValue"/>
</s:text>

where format.decimal is defined in a resource bundle somewhere (see
http://cwiki.apache.org/confluence/display/WW/Localization for
details) as:

format.decimal={0,number,###.##}

The text tag reference
(http://cwiki.apache.org/confluence/display/WW/text) has some links to
more information about using MessageFormat.

Josh



On 6/9/07, Antonio Petrelli <[EMAIL PROTECTED]> wrote:
2007/6/9, Shuai Zheng <[EMAIL PROTECTED]>:
> Dear All,
>
> I want to keep all the numeric in my system with 2 decimal places only. What
> is the best way to do it?

Use fmt:formatNumber contained in JSTL:
http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fmt/formatNumber.html

HTH
Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to