Apr 29

Sometimes you need to get the currency symbol used for your currency in a different Locale. eg. In the US they use $, but a different Locale may use US$.

The Currency class can be used to not only get the currency symbol for a Locale, but also the currency symbol used for your currency in a different Locale.

Currency currency = Currency.getInstance(myLocale);
String symbol = currency.getSymbol(otherLocale);

written by objects \\ tags: , ,

Apr 25

The Currency class can be used to get the currency symbol used for a particular Locale as shown in the following example.

Currency currency = Currency.getInstance(locale);
String symbol = currency.getSymbol();

written by objects \\ tags: , ,