Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why is Locale not working here?

 
Jehan Jaleel
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15272
37
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic