| Author |
<fmt:formatNumber question
|
Tony Evans
Ranch Hand
Joined: Jun 29, 2002
Posts: 521
|
|
I am trying to format numbers so if I get 6664,4000 I will return 6664.4000
if i get 6664,4000,230 I will return 66644000.230
As I understand it I use fmt:formatNumber var="levelAmt" value="${value.levelAmount}" pattern="Some pattern"/>
But I cant find any link that goes into the pattern, what patterns mean, what is the difference say between 0.000 an 0.0##.
Thanks for any help or any helpful links.
Thanks Tony
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56150
|
|
|
java.text.DecimalFormat
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Tony Evans
Ranch Hand
Joined: Jun 29, 2002
Posts: 521
|
|
Thanks Bear Bibeault the nature of the software looking at a jsp fix before changing the code, is it possible to do this using <fmt:formatNumber with the correct pattern, is there a link with a good explantion of using patterns
Thanks Tony>
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56150
|
|
|
The patterns are described in the javadoc that I linked to. The numberFormat tag uses DecimalFormat under the covers.
|
 |
Tony Evans
Ranch Hand
Joined: Jun 29, 2002
Posts: 521
|
|
Thanks Bear Bibeault I think I have been given a impossible task given the number 6664,4000 it will convert it to 66644000.00 not 6664.4000 dealing with German an NL currency.
I am using mso-number-format is there anything you can add to a pattern to say its german so dont treat , as a decimal thousand.
Thanks for any help
Tony
|
 |
Sai Hegde
security forum advocate
Ranch Hand
Joined: Oct 26, 2010
Posts: 183
|
|
|
shouldn't the pattern #.00 be what you need?
|
 |
Tony Evans
Ranch Hand
Joined: Jun 29, 2002
Posts: 521
|
|
Thanks for the replys I found a soultion use mso
|
 |
Sai Hegde
security forum advocate
Ranch Hand
Joined: Oct 26, 2010
Posts: 183
|
|
Great.. and you thought it was impossible
|
 |
 |
|
|
subject: <fmt:formatNumber question
|
|
|