Skip to content Skip to sidebar Skip to footer

Android Currency Symbol Ordering

I'm getting on devices with not-english locale, the english currencies formated like this: 1 $ If I have english locale I get euro currency like: € 1 Using format.setCurrency(Cur

Solution 1:

The behaviour of the method is correct.

Not all countries expect the currency symbol before the amount.

If you always want the currency format to match an Americanised expectation, leave the locale as Locale.US. If you want the currency to display in a localised way, leave your implementation as is.

See this brief guide (from Microsoft, no less):

Currency Formatting

I'd guess what you may be trying to achieve is to display the currency in a format appropriate to its locale? If that's the case, just match the locale to the currency you're using, before calling the method.

Note that the format can even vary in the same country. In Canada, it's reasonably common to see English speakers use the format $50.00, whereas French-Canadians may use 50,00 $.

Also see this question on UX:

https://ux.stackexchange.com/questions/22574/where-to-place-currency-symbol-when-localizing-and-what-to-do-with-odd-symbols


Post a Comment for "Android Currency Symbol Ordering"