aspose file tools*
The moose likes Beginning Java and the fly likes Number Format problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Number Format problem" Watch "Number Format problem" New topic
Author

Number Format problem

Yaddif Medina
Greenhorn

Joined: Oct 05, 2005
Posts: 23
Hi all,

I have a problem with my web application in Linux (White Box 4). The DecimalFormat that I am using does not take into account the "regional setting". The linux have the numeric format as : "12,123,123.45" (which I wanted), but when I executed the following sentence it returns "12.123.123,45" !!!.

java.text.NumberFormat df=java.text.DecimalFormat.getCurrencyInstance(java.util.Locale.US);

How can I force to the right format? it is not supposed to be taken from the operating system?.

PS. If I run my application in a windows server it works fine.

Thanks in advance.

Yaddif
Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1296
I'm not sure why you're getting the results you're getting. You could try specifically setting the DecimalFormatSymbols to the US Locale.

[ March 18, 2006: Message edited by: Garrett Rowe ]

Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Yaddif Medina
Greenhorn

Joined: Oct 05, 2005
Posts: 23
The problem is that I am running Jasper Report for my application and it is not formating the number as the "regional setting" ... are there some "global" java parameter to do this?

Thanks
 
wood burning stoves
 
subject: Number Format problem