You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Evgeny Gesin <ev...@yahoo.com> on 2003/12/23 21:17:56 UTC

i18n:formatPercent starnge result

When I do in JSP in a circle

  <%= pack.getName() %>:<%= pack.getPercent(i) %>

these lines are sent to web browser

A:80.36
B:5.36
C:14.29

Now I want to send the same output as a formatted
"percentage" of A, B, C using "Jakarta i18n" tag
library.

When I do in a circle

  <%= pack.getName() %>:<i18n:formatPercent value="<%=
new Double(pack.getPercent(i)) %>"/>

these lines are sent to web browser, which are not
correct (why i18n:formatPercent produces wrong
output?)

A:8,036%
B:536%
C:1,429%

and if I do (* 10)

  <%= pack.getName() %>:<i18n:formatPercent value="<%=
new Double(pack.getPercent(i) * 10) %>"/>

these lines are sent to web browser, which are correct

A:80,360%
B:5,360%
C:14,290%

but have "0" digit at the end of each number. How to
remove that ending "0" ?

Evgeny Gesin
Javadesk

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org