File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes <fmt:formatNumber  question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "<fmt:formatNumber  question" Watch "<fmt:formatNumber  question" New topic
Author

<fmt:formatNumber question

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 556
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: 60053
    
  65

java.text.DecimalFormat


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 556
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: 60053
    
  65

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: 556
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: 198

shouldn't the pattern #.00 be what you need?
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 556
Thanks for the replys I found a soultion use mso



Sai Hegde
security forum advocate
Ranch Hand

Joined: Oct 26, 2010
Posts: 198

Great.. and you thought it was impossible
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: <fmt:formatNumber question
 
Similar Threads
JSTL fmt:formatNumber does not display currency
Formatting Currency Value in JSTL
MultiDimenaional Array sort
Display an array in a swing type box
Formatting Number as percentage using <fmt:FormatNumber>