This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Problem in setting locale Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Problem in setting locale" Watch "Problem in setting locale" New topic
Author

Problem in setting locale

Pallavi Vidhate
Greenhorn

Joined: Apr 14, 2003
Posts: 4
Hi,
I want to display my data (which is numeric) in German format.
I am able to do so using the following code :
double dbl=2345.67;
NumberFormat nf= NumberFormat.getInstance(Locale.GERMAN);
((DecimalFormat)nf).applyPattern("#,##0.#");
str_output=nf.format(dbl);
But this code works only on some machines.
On other machines it shows the data in the default English format only.
Pls help.
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1114

Hi Pallavi,
This is just a guess, but the machines that you say are not displaying the number in German format, may be missing the appropriate "properties" files associated with the German locale.
In case you haven't already discovered it, perhaps this Web site may be of help:
http://www.joconner.com
Good Luck,
Avi.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Problem in setting locale
 
Similar Threads
decimal precision
Problems in setting a locale
Setting decimalFormatSymbols
String conversion in to double
help with number formats