Example usage for java.util Currency getInstance

List of usage examples for java.util Currency getInstance

Introduction

In this page you can find the example usage for java.util Currency getInstance.

Prototype

public static Currency getInstance(Locale locale) 

Source Link

Document

Returns the Currency instance for the country of the given locale.

Usage

From source file:Main.java

public static void main(String args[]) {

    Currency curr1 = Currency.getInstance("USD");
    Currency curr2 = Currency.getInstance("JPY");

    System.out.println("USD fraction digits:" + curr1.getDefaultFractionDigits());
    System.out.println("JPY fraction digits:" + curr2.getDefaultFractionDigits());
}

From source file:Main.java

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

}

From source file:Main.java

public static void main(String[] args) {
    Currency currency = Currency.getInstance(Locale.UK);
    System.out.println("United Kingdom: " + currency.getSymbol());

}

From source file:Main.java

public static void main(String[] args) {
    Currency currency = Currency.getInstance(Locale.US);
    System.out.println("United States: " + currency.getSymbol());

}

From source file:Main.java

public static void main(String[] args) {
    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());
}

From source file:Main.java

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());
}

From source file:Main.java

public static void main(String args[]) {

    // create a currency for euro
    Currency curr = Currency.getInstance("EUR");

    // get and print the symbol of the currency
    System.out.println("Currency symbol is = " + curr.getSymbol());
}

From source file:Main.java

public static void main(String args[]) {

    // create a currency with eur code
    Currency curr = Currency.getInstance("EUR");

    // get currency code and print it
    String curCode = curr.getCurrencyCode();
    System.out.println("Currency Code is = " + curCode);
}

From source file:Main.java

public static void main(String args[]) {
    Locale locale = Locale.UK;
    Currency curr = Currency.getInstance(locale);

    System.out.println(curr.getDisplayName());
}

From source file:Main.java

public static void main(String args[]) {
    Locale locale = Locale.UK;
    Currency curr = Currency.getInstance(locale);

    System.out.println(curr.getCurrencyCode());
}