Greengiants15
asked on
Java and Currency Counting (Brazil)
Hi Experts,
I'm trying to format currency in Brazil but Java simply does not know how to handle this.
ex:
NumberFormat format = NumberFormat.getInstance(n ew Locale("br"));
Object value = format.parse("5,45");
value ends up translating to 54500. It's very strange. Does anyone know why and how I can properly format the value?
Thanks!
I'm trying to format currency in Brazil but Java simply does not know how to handle this.
ex:
NumberFormat format = NumberFormat.getInstance(n
Object value = format.parse("5,45");
value ends up translating to 54500. It's very strange. Does anyone know why and how I can properly format the value?
Thanks!
and you should be use getCurrencyInstance() to parse a currency value
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
:)
http://helpdesk.objects.com.au/java/get-the-currency-symbol-used-in-a-different-locale