1 *java.util.Currency* *Currency* Represents a currency.
3 public final class Currency
4 extends |java.lang.Object|
5 implements |java.io.Serializable|
7 |java.util.Currency_Description|
8 |java.util.Currency_Fields|
9 |java.util.Currency_Constructors|
10 |java.util.Currency_Methods|
12 ================================================================================
14 *java.util.Currency_Methods*
15 |java.util.Currency.getCurrencyCode()|Gets the ISO 4217 currency code of this c
16 |java.util.Currency.getDefaultFractionDigits()|Gets the default number of fract
17 |java.util.Currency.getInstance(Locale)|Returns the Currency instance for the c
18 |java.util.Currency.getInstance(String)|Returns the Currency instance for the g
19 |java.util.Currency.getSymbol()|Gets the symbol of this currency for the defaul
20 |java.util.Currency.getSymbol(Locale)|Gets the symbol of this currency for the
21 |java.util.Currency.toString()|Returns the ISO 4217 currency code of this curre
23 *java.util.Currency_Description*
25 Represents a currency. Currencies are identified by their ISO 4217 currency
26 codes. Visit the BSi web site for more information, including a table of
29 The class is designed so that there's never more than one Currency instance for
30 any given currency. Therefore, there's no public constructor. You obtain a
31 Currency instance using the getInstance methods.
35 *java.util.Currency.getCurrencyCode()*
37 public |java.lang.String| getCurrencyCode()
39 Gets the ISO 4217 currency code of this currency.
43 Returns: the ISO 4217 currency code of this currency.
45 *java.util.Currency.getDefaultFractionDigits()*
47 public int getDefaultFractionDigits()
49 Gets the default number of fraction digits used with this currency. For
50 example, the default number of fraction digits for the Euro is 2, while for the
51 Japanese Yen it's 0. In the case of pseudo-currencies, such as IMF Special
52 Drawing Rights, -1 is returned.
56 Returns: the default number of fraction digits used with this currency
58 *java.util.Currency.getInstance(Locale)*
60 public static |java.util.Currency| getInstance(java.util.Locale locale)
62 Returns the Currency instance for the country of the given locale. The language
63 and variant components of the locale are ignored. The result may vary over
64 time, as countries change their currencies. For example, for the original
65 member countries of the European Monetary Union, the method returns the old
66 national currencies until December 31, 2001, and the Euro from January 1, 2002,
67 local time of the respective countries.
69 The method returns null for territories that don't have a currency, such as
73 locale - the locale for whose country a Currency instance is needed
75 Returns: the Currency instance for the country of the given locale, or null
77 *java.util.Currency.getInstance(String)*
79 public static |java.util.Currency| getInstance(java.lang.String currencyCode)
81 Returns the Currency instance for the given currency code.
84 currencyCode - the ISO 4217 code of the currency
86 Returns: the Currency instance for the given currency code
88 *java.util.Currency.getSymbol()*
90 public |java.lang.String| getSymbol()
92 Gets the symbol of this currency for the default locale. For example, for the
93 US Dollar, the symbol is "$" if the default locale is the US, while for other
94 locales it may be "US$". If no symbol can be determined, the ISO 4217 currency
99 Returns: the symbol of this currency for the default locale
101 *java.util.Currency.getSymbol(Locale)*
103 public |java.lang.String| getSymbol(java.util.Locale locale)
105 Gets the symbol of this currency for the specified locale. For example, for the
106 US Dollar, the symbol is "$" if the specified locale is the US, while for other
107 locales it may be "US$". If no symbol can be determined, the ISO 4217 currency
111 locale - the locale for which a display name for this currency is needed
113 Returns: the symbol of this currency for the specified locale
115 *java.util.Currency.toString()*
117 public |java.lang.String| toString()
119 Returns the ISO 4217 currency code of this currency.
123 Returns: the ISO 4217 currency code of this currency