Example usage for java.util Currency getDisplayName

List of usage examples for java.util Currency getDisplayName

Introduction

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

Prototype

public String getDisplayName(Locale locale) 

Source Link

Document

Gets the name that is suitable for displaying this currency for the specified locale.

Usage

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

From source file:Main.java

@TargetApi(Build.VERSION_CODES.KITKAT)
public static String[] get_Currency_Name_And_Currency_Code(String iso2) {
    String[] str = new String[2];
    Locale locale = new Locale("", iso2);
    Currency currency = Currency.getInstance(locale);
    str[0] = currency.getDisplayName(Locale.ENGLISH);
    str[1] = currency.toString();//w  w w .  j  a  v  a2 s .  c  o m
    return str;

}