Save This Page
Home » apache-harmony-6.0-src-r917296-snapshot » java » util » [javadoc | source]
java.util
public final class: Currency [javadoc | source]
java.lang.Object
   java.util.Currency

All Implemented Interfaces:
    Serializable

This class represents a currency as identified in the ISO 4217 currency codes.
Method from java.util.Currency Summary:
getCurrencyCode,   getDefaultFractionDigits,   getInstance,   getInstance,   getSymbol,   getSymbol,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.util.Currency Detail:
 public String getCurrencyCode() 
    Returns this {@code Currency}'s ISO 4217 currency code.
 public int getDefaultFractionDigits() 
    Returns the default number of fraction digits for this currency. For instance, the default number of fraction digits for the US dollar is 2. For the Japanese Yen the number is 0. In the case of pseudo-currencies, such as IMF Special Drawing Rights, -1 is returned.
 public static Currency getInstance(String currencyCode) 
    Returns the {@code Currency} instance for this currency code.

 public static Currency getInstance(Locale locale) 
    Returns the {@code Currency} instance for this {@code Locale}'s country.
 public String getSymbol() 
    Returns the symbol for this currency in the default locale. For instance, if the default locale is the US, the symbol of the US dollar is "$". For other locales it may be "US$". If no symbol can be determined, the ISO 4217 currency code of the US dollar is returned.
 public String getSymbol(Locale locale) 
    Returns the symbol for this currency in the given {@code Locale}.

    If the locale doesn't have any countries (e.g. {@code Locale.JAPANESE, new Locale("en","")}), the the ISO 4217 currency code is returned.

    First the locale's resource bundle is checked, if the locale has the same currency, the CurrencySymbol in this locale bundle is returned.

    Then a currency bundle for this locale is searched.

    If a currency bundle for this locale does not exist, or there is no symbol for this currency in this bundle, then the ISO 4217 currency code is returned.

 public String toString() 
    Returns this currency's ISO 4217 currency code.