wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Problem in setting locale Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem in setting locale" Watch "Problem in setting locale" New topic

Problem in setting locale

Pallavi Vidhate

Joined: Apr 14, 2003
Posts: 4
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);
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: 1121

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:
Good Luck,
It is sorta covered in the JavaRanch Style Guide.
subject: Problem in setting locale
Similar Threads
Setting decimalFormatSymbols
decimal precision
Problems in setting a locale
help with number formats
String conversion in to double