• Post Reply Bookmark Topic Watch Topic
  • New Topic

NumberFormat / currency  RSS feed

 
mark reusen
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd like to format the price in a Euro sign, I tried without an argument and also with argument Locale.GERMAN.
Result is no format.

When I use Locale.UK as an argument it works fine, then the Pound-sign appears...... also with the Locale.US (Dollar-sign appears)

NumberFormat currency = NumberFormat.getCurrencyInstance(Locale.GERMAN);
return currency.format(price);


price is defined as a double by the way..
 
Mohamed Sanaulla
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Locale.GERMAN is for language, you might want to try- Locale.GERMANY as it would represent the country and that way also the currency. By the way Locale.US/Locale.UK represents the country.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!