struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bhaarat Sharma <bhaara...@gmail.com>
Subject how to format a percentage
Date Tue, 05 May 2009 18:57:33 GMT
I have the following in my properties file:
format.percent = {0,number,##0.00'%'}

But the following code doesnt work and always gives 0.00%

<s:text name="format.percent"><s:param value="%{( (50 / 200) *
100)}"/></s:text>
...evaluates to <s:text name="format.percent"><s:param value="%{( (.25) *
100)}"/></s:text>



However, the following code does work...

<s:text name="format.percent"><s:param value="%{( (200 / 50) *
100)}"/></s:text>
...evaluates to <s:text name="format.percent"><s:param value="%{( (4) *
100)}"/></s:text>

What is going on here? why dont decimals work?

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