This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Why is Locale not working here? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Why is Locale not working here?" Watch "Why is Locale not working here?" New topic
Author

Why is Locale not working here?

Jehan Jaleel
Ranch Hand

Joined: Apr 30, 2002
Posts: 196
Hi,

I need to format monetary amounts by the country and the language. But I cannot seem to get the right currency symbol for all currencies. For example I have the following code..



Here I am trying to format 1000 in Euros (the official currency of Slovakia), I want the amont to appear with the currency symbol. But what I get is..

1 000,00 Sk

Is this how it is supposed to be? I checked in NumberFormat's getAvailableLocales and I am seeing that Slovakia is supported. So what am I missing?

Thanks.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Are you using an older version of Java? Slovakia switched to Euros relatively recently (1 January 2009 according to Wikipedia). It could be that you are using an old version of Java from the time when the official currency was still Slovakian crowns (Sk).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
jQuery in Action, 2nd edition
 
subject: Why is Locale not working here?
 
Similar Threads
Question related to java.util.Currency's getSymbol method.
$ symbol not displayed properly in excel
Getting currency symbols
custom currency formatting
Localized Currency formatting issue