Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in setting locale

 
Pallavi Vidhate
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic