dcsimg
default Locale
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Tofik_Akhmedov
Posted On:   Tuesday, August 14, 2001 10:12 AM

Getting default Locale settings, which is suppose to be en_US on our Solaris system ... Locale defaultLocale = Locale.getDefault(); ...I want to show the default currency sign $ ... NumberFormat nf = NumberFormat.getCurrencyInstance(defaultLocale); ..., but it prints pattern's currency sign symbol ¤ What should I do to get the $ sign right in the place, instead of ¤ ? (By the way, the same program works properly on NT environment). Some System properties: java.vm.info - build Solaris_JDK_1.2.2_06 java.specification.version - 1.2 user.language - en    More>>

Getting default Locale settings, which is suppose to be en_US on our Solaris system ...

Locale defaultLocale = Locale.getDefault();

...I want to show the default currency sign $ ...

NumberFormat nf = NumberFormat.getCurrencyInstance(defaultLocale);

..., but it prints pattern's currency sign symbol ¤


What should I do to get the $ sign right in the place, instead of ¤ ? (By the way, the same program works properly on NT environment).

Some System properties:


  • java.vm.info - build Solaris_JDK_1.2.2_06

  • java.specification.version - 1.2

  • user.language - en

   <<Less

Re: default Locale

Posted By:   Thierry_Sourbier  
Posted On:   Thursday, August 16, 2001 02:34 AM

Have you tried setting directly the default locale instead of relying on the default locale?



NumberFormat nf = NumberFormat.getCurrencyInstance(Locale("en","US"));




You can also verify what you default locale is by executing:



Locale defaultLocale = Locale.getDefault();
System.out.println(defaultLocale.toString());



Cheers,


Thierry Sourbier
About | Sitemap | Contact