Get currency symbol : Currency « I18N « Java Tutorial






import java.util.Currency;
import java.util.Locale;

public class Main {
  public static void main(String[] args) {
    Currency currency = Currency.getInstance(Locale.JAPAN);
    System.out.println("Currency.getSymbol() = " + currency.getSymbol());

    currency = Currency.getInstance(Locale.UK);
    System.out.println("Currency.getSymbol() = " + currency.getSymbol());

    currency = Currency.getInstance(Locale.US);
    System.out.println("Currency.getSymbol() = " + currency.getSymbol());

    currency = Currency.getInstance(new Locale("in", "ID"));
    System.out.println("Currency.getSymbol() = " + currency.getSymbol());
  }
}








13.11.Currency
13.11.1.Load currecy locale, code and symbol to JTableLoad currecy locale, code and symbol to JTable
13.11.2.Create Currency from a Locale and get its symbol and Default Fraction Digits
13.11.3.Getting Currency Symbols for Locale.US
13.11.4.Getting Currency Symbols for Locale.UK
13.11.5.Getting Currency Symbols for Locale.FRANCE
13.11.6.Get currency symbol