I want to get the currency format of India, so I need a Locale
object for India. But there exists only few a countries that have a Locale
constant (a static final Locale
), and India is not one of them.
To get the currency symbols for the US and UK, I can do the following:
public void displayCurrencySymbols() {
Currency currency = Currency.getInstance(Locale.US);
System.out.println("United States: " + currency.getSymbol());
currency = Currency.getInstance(Locale.UK);
System.out.println("United Kingdom: " + currency.getSymbol());
}
That uses the constants Locale.US
and Locale.UK
. If i want to get the Indian currency format, what can I do?