# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Nested Classes | Constants | Inherited Fields | Protected Ctors | Methods | Inherited Methods

# Currency

`public class Currency`
`` `extends MeasureUnit` ``

java.lang.Object
↳ | android.icu.util.MeasureUnit
| ↳ | android.icu.util.Currency

A class encapsulating a currency, as defined by ISO 4217. A `Currency` object can be created given a `Locale` or given an ISO 4217 code. Once created, the `Currency` object can return various data necessary to its proper display:

- A display symbol, for a specific locale
- The number of fraction digits to display
- A rounding increment

The `DecimalFormat` class uses these data to display currencies.

Note: This class deliberately resembles `java.util.Currency` but it has a completely independent implementation, and adds features not present in the JDK.

## Summary

### Nested classes
`enum` | `Currency.CurrencyUsage` Currency Usage used for Decimal Format

### Constants
`int` | `LONG_NAME` Selector for getName() indicating the long name for a currency, such as "US Dollar" for USD.
`int` | `NARROW_SYMBOL_NAME` Selector for getName() indicating the narrow currency symbol.
`int` | `PLURAL_LONG_NAME` Selector for getName() indicating the plural long name for a currency, such as "US dollar" for USD in "1 US dollar", and "US dollars" for USD in "2 US dollars".
`int` | `SYMBOL_NAME` Selector for getName() indicating a symbolic name for a currency, such as "$" for USD.

### Inherited fields
From class `android.icu.util.MeasureUnit`
`public static final MeasureUnit` | `ACRE` Constant for unit of area: acre
`public static final MeasureUnit` | `ACRE_FOOT` Constant for unit of volume: acre-foot
`public static final MeasureUnit` | `AMPERE` Constant for unit of electric: ampere
`public static final MeasureUnit` | `ARC_MINUTE` Constant for unit of angle: arc-minute
`public static final MeasureUnit` | `ARC_SECOND` Constant for unit of angle: arc-second
`public static final MeasureUnit` | `ASTRONOMICAL_UNIT` Constant for unit of length: astronomical-unit
`public static final MeasureUnit` | `ATMOSPHERE` Constant for unit of pressure: atmosphere
`public static final MeasureUnit` | `BIT` Constant for unit of digital: bit
`public static final MeasureUnit` | `BUSHEL` Constant for unit of volume: bushel
`public static final MeasureUnit` | `BYTE` Constant for unit of digital: byte
`public static final MeasureUnit` | `CALORIE` Constant for unit of energy: calorie
`public static final MeasureUnit` | `CARAT` Constant for unit of mass: carat
`public static final MeasureUnit` | `CELSIUS` Constant for unit of temperature: celsius
`public static final MeasureUnit` | `CENTILITER` Constant for unit of volume: centiliter
`public static final MeasureUnit` | `CENTIMETER` Constant for unit of length: centimeter
`public static final MeasureUnit` | `CENTURY` Constant for unit of duration: century
`public static final MeasureUnit` | `CUBIC_CENTIMETER` Constant for unit of volume: cubic-centimeter
`public static final MeasureUnit` | `CUBIC_FOOT` Constant for unit of volume: cubic-foot
`public static final MeasureUnit` | `CUBIC_INCH` Constant for unit of volume: cubic-inch
`public static final MeasureUnit` | `CUBIC_KILOMETER` Constant for unit of volume: cubic-kilometer
`public static final MeasureUnit` | `CUBIC_METER` Constant for unit of volume: cubic-meter
`public static final MeasureUnit` | `CUBIC_MILE` Constant for unit of volume: cubic-mile
`public static final MeasureUnit` | `CUBIC_YARD` Constant for unit of volume: cubic-yard
`public static final MeasureUnit` | `CUP` Constant for unit of volume: cup
`public static final MeasureUnit` | `CUP_METRIC` Constant for unit of volume: cup-metric
`public static final TimeUnit` | `DAY` Constant for unit of duration: day
`public static final MeasureUnit` | `DECILITER` Constant for unit of volume: deciliter
`public static final MeasureUnit` | `DECIMETER` Constant for unit of length: decimeter
`public static final MeasureUnit` | `DEGREE` Constant for unit of angle: degree
`public static final MeasureUnit` | `FAHRENHEIT` Constant for unit of temperature: fahrenheit
`public static final MeasureUnit` | `FATHOM` Constant for unit of length: fathom
`public static final MeasureUnit` | `FLUID_OUNCE` Constant for unit of volume: fluid-ounce
`public static final MeasureUnit` | `FOODCALORIE` Constant for unit of energy: foodcalorie
`public static final MeasureUnit` | `FOOT` Constant for unit of length: foot
`public static final MeasureUnit` | `FURLONG` Constant for unit of length: furlong
`public static final MeasureUnit` | `GALLON` Constant for unit of volume: gallon
`public static final MeasureUnit` | `GALLON_IMPERIAL` Constant for unit of volume: gallon-imperial
`public static final MeasureUnit` | `GENERIC_TEMPERATURE` Constant for unit of temperature: generic
`public static final MeasureUnit` | `GIGABIT` Constant for unit of digital: gigabit
`public static final MeasureUnit` | `GIGABYTE` Constant for unit of digital: gigabyte
`public static final MeasureUnit` | `GIGAHERTZ` Constant for unit of frequency: gigahertz
`public static final MeasureUnit` | `GIGAWATT` Constant for unit of power: gigawatt
`public static final MeasureUnit` | `GRAM` Constant for unit of mass: gram
`public static final MeasureUnit` | `G_FORCE` Constant for unit of acceleration: g-force
`public static final MeasureUnit` | `HECTARE` Constant for unit of area: hectare
`public static final MeasureUnit` | `HECTOLITER` Constant for unit of volume: hectoliter
`public static final MeasureUnit` | `HECTOPASCAL` Constant for unit of pressure: hectopascal
`public static final MeasureUnit` | `HERTZ` Constant for unit of frequency: hertz
`public static final MeasureUnit` | `HORSEPOWER` Constant for unit of power: horsepower
`public static final TimeUnit` | `HOUR` Constant for unit of duration: hour
`public static final MeasureUnit` | `INCH` Constant for unit of length: inch
`public static final MeasureUnit` | `INCH_HG` Constant for unit of pressure: inch-hg
`public static final MeasureUnit` | `JOULE` Constant for unit of energy: joule
`public static final MeasureUnit` | `KARAT` Constant for unit of concentr: karat
`public static final MeasureUnit` | `KELVIN` Constant for unit of temperature: kelvin
`public static final MeasureUnit` | `KILOBIT` Constant for unit of digital: kilobit
`public static final MeasureUnit` | `KILOBYTE` Constant for unit of digital: kilobyte
`public static final MeasureUnit` | `KILOCALORIE` Constant for unit of energy: kilocalorie
`public static final MeasureUnit` | `KILOGRAM` Constant for unit of mass: kilogram
`public static final MeasureUnit` | `KILOHERTZ` Constant for unit of frequency: kilohertz
`public static final MeasureUnit` | `KILOJOULE` Constant for unit of energy: kilojoule
`public static final MeasureUnit` | `KILOMETER` Constant for unit of length: kilometer
`public static final MeasureUnit` | `KILOMETER_PER_HOUR` Constant for unit of speed: kilometer-per-hour
`public static final MeasureUnit` | `KILOWATT` Constant for unit of power: kilowatt
`public static final MeasureUnit` | `KILOWATT_HOUR` Constant for unit of energy: kilowatt-hour
`public static final MeasureUnit` | `KNOT` Constant for unit of speed: knot
`public static final MeasureUnit` | `LIGHT_YEAR` Constant for unit of length: light-year
`public static final MeasureUnit` | `LITER` Constant for unit of volume: liter
`public static final MeasureUnit` | `LITER_PER_100KILOMETERS` Constant for unit of consumption: liter-per-100kilometers
`public static final MeasureUnit` | `LITER_PER_KILOMETER` Constant for unit of consumption: liter-per-kilometer
`public static final MeasureUnit` | `LUX` Constant for unit of light: lux
`public static final MeasureUnit` | `MEGABIT` Constant for unit of digital: megabit
`public static final MeasureUnit` | `MEGABYTE` Constant for unit of digital: megabyte
`public static final MeasureUnit` | `MEGAHERTZ` Constant for unit of frequency: megahertz
`public static final MeasureUnit` | `MEGALITER` Constant for unit of volume: megaliter
`public static final MeasureUnit` | `MEGAWATT` Constant for unit of power: megawatt
`public static final MeasureUnit` | `METER` Constant for unit of length: meter
`public static final MeasureUnit` | `METER_PER_SECOND` Constant for unit of speed: meter-per-second
`public static final MeasureUnit` | `METER_PER_SECOND_SQUARED` Constant for unit of acceleration: meter-per-second-squared
`public static final MeasureUnit` | `METRIC_TON` Constant for unit of mass: metric-ton
`public static final MeasureUnit` | `MICROGRAM` Constant for unit of mass: microgram
`public static final MeasureUnit` | `MICROMETER` Constant for unit of length: micrometer
`public static final MeasureUnit` | `MICROSECOND` Constant for unit of duration: microsecond
`public static final MeasureUnit` | `MILE` Constant for unit of length: mile
`public static final MeasureUnit` | `MILE_PER_GALLON` Constant for unit of consumption: mile-per-gallon
`public static final MeasureUnit` | `MILE_PER_GALLON_IMPERIAL` Constant for unit of consumption: mile-per-gallon-imperial
`public static final MeasureUnit` | `MILE_PER_HOUR` Constant for unit of speed: mile-per-hour
`public static final MeasureUnit` | `MILE_SCANDINAVIAN` Constant for unit of length: mile-scandinavian
`public static final MeasureUnit` | `MILLIAMPERE` Constant for unit of electric: milliampere
`public static final MeasureUnit` | `MILLIBAR` Constant for unit of pressure: millibar
`public static final MeasureUnit` | `MILLIGRAM` Constant for unit of mass: milligram
`public static final MeasureUnit` | `MILLIGRAM_PER_DECILITER` Constant for unit of concentr: milligram-per-deciliter
`public static final MeasureUnit` | `MILLILITER` Constant for unit of volume: milliliter
`public static final MeasureUnit` | `MILLIMETER` Constant for unit of length: millimeter
`public static final MeasureUnit` | `MILLIMETER_OF_MERCURY` Constant for unit of pressure: millimeter-of-mercury
`public static final MeasureUnit` | `MILLIMOLE_PER_LITER` Constant for unit of concentr: millimole-per-liter
`public static final MeasureUnit` | `MILLISECOND` Constant for unit of duration: millisecond
`public static final MeasureUnit` | `MILLIWATT` Constant for unit of power: milliwatt
`public static final TimeUnit` | `MINUTE` Constant for unit of duration: minute
`public static final TimeUnit` | `MONTH` Constant for unit of duration: month
`public static final MeasureUnit` | `NANOMETER` Constant for unit of length: nanometer
`public static final MeasureUnit` | `NANOSECOND` Constant for unit of duration: nanosecond
`public static final MeasureUnit` | `NAUTICAL_MILE` Constant for unit of length: nautical-mile
`public static final MeasureUnit` | `OHM` Constant for unit of electric: ohm
`public static final MeasureUnit` | `OUNCE` Constant for unit of mass: ounce
`public static final MeasureUnit` | `OUNCE_TROY` Constant for unit of mass: ounce-troy
`public static final MeasureUnit` | `PARSEC` Constant for unit of length: parsec
`public static final MeasureUnit` | `PART_PER_MILLION` Constant for unit of concentr: part-per-million
`public static final MeasureUnit` | `PERCENT` Constant for unit of concentr: percent
`public static final MeasureUnit` | `PERMILLE` Constant for unit of concentr: permille
`public static final MeasureUnit` | `PETABYTE` Constant for unit of digital: petabyte
`public static final MeasureUnit` | `PICOMETER` Constant for unit of length: picometer
`public static final MeasureUnit` | `PINT` Constant for unit of volume: pint
`public static final MeasureUnit` | `PINT_METRIC` Constant for unit of volume: pint-metric
`public static final MeasureUnit` | `POINT` Constant for unit of length: point
`public static final MeasureUnit` | `POUND` Constant for unit of mass: pound
`public static final MeasureUnit` | `POUND_PER_SQUARE_INCH` Constant for unit of pressure: pound-per-square-inch
`public static final MeasureUnit` | `QUART` Constant for unit of volume: quart
`public static final MeasureUnit` | `RADIAN` Constant for unit of angle: radian
`public static final MeasureUnit` | `REVOLUTION_ANGLE` Constant for unit of angle: revolution
`public static final TimeUnit` | `SECOND` Constant for unit of duration: second
`public static final MeasureUnit` | `SQUARE_CENTIMETER` Constant for unit of area: square-centimeter
`public static final MeasureUnit` | `SQUARE_FOOT` Constant for unit of area: square-foot
`public static final MeasureUnit` | `SQUARE_INCH` Constant for unit of area: square-inch
`public static final MeasureUnit` | `SQUARE_KILOMETER` Constant for unit of area: square-kilometer
`public static final MeasureUnit` | `SQUARE_METER` Constant for unit of area: square-meter
`public static final MeasureUnit` | `SQUARE_MILE` Constant for unit of area: square-mile
`public static final MeasureUnit` | `SQUARE_YARD` Constant for unit of area: square-yard
`public static final MeasureUnit` | `STONE` Constant for unit of mass: stone
`public static final MeasureUnit` | `TABLESPOON` Constant for unit of volume: tablespoon
`public static final MeasureUnit` | `TEASPOON` Constant for unit of volume: teaspoon
`public static final MeasureUnit` | `TERABIT` Constant for unit of digital: terabit
`public static final MeasureUnit` | `TERABYTE` Constant for unit of digital: terabyte
`public static final MeasureUnit` | `TON` Constant for unit of mass: ton
`public static final MeasureUnit` | `VOLT` Constant for unit of electric: volt
`public static final MeasureUnit` | `WATT` Constant for unit of power: watt
`public static final TimeUnit` | `WEEK` Constant for unit of duration: week
`public static final MeasureUnit` | `YARD` Constant for unit of length: yard
`public static final TimeUnit` | `YEAR` Constant for unit of duration: year

### Protected constructors
`Currency(String theISOCode)` Constructs a currency object for the given ISO 4217 3-letter code.

### Public methods
`static Currency` | `fromJavaCurrency(Currency currency)` Returns a Currency object based on the currency represented by the given java.util.Currency.
`static Set<Currency>` | `getAvailableCurrencies()` Returns the set of available currencies.
`static String[]` | `getAvailableCurrencyCodes(ULocale loc, Date d)` Returns an array of Strings which contain the currency identifiers that are valid for the given locale on the given date.
`static String[]` | `getAvailableCurrencyCodes(Locale loc, Date d)` Returns an array of Strings which contain the currency identifiers that are valid for the given `Locale` on the given date.
`static Locale[]` | `getAvailableLocales()` Return an array of the locales for which a currency is defined.
`static ULocale[]` | `getAvailableULocales()` Return an array of the ulocales for which a currency is defined.
`String` | `getCurrencyCode()` Returns the ISO 4217 3-letter code for this currency object.
`int` | `getDefaultFractionDigits()` Returns the number of the number of fraction digits that should be displayed for this currency.
`int` | `getDefaultFractionDigits(Currency.CurrencyUsage Usage)` Returns the number of the number of fraction digits that should be displayed for this currency with Usage.
`String` | `getDisplayName()` Returns the display name for this currency in the default locale.
`String` | `getDisplayName(Locale locale)` Returns the display name for this currency in the given locale.
`static Currency` | `getInstance(String theISOCode)` Returns a currency object given an ISO 4217 3-letter code.
`static Currency` | `getInstance(Locale locale)` Returns a currency object for the default currency in the given locale.
`static Currency` | `getInstance(ULocale locale)` Returns a currency object for the default currency in the given locale.
`static final String[]` | `getKeywordValuesForLocale(String key, ULocale locale, boolean commonlyUsed)` Given a key and a locale, returns an array of values for the key for which data exists.
`String` | `getName(Locale locale, int nameStyle, String pluralCount, boolean[] isChoiceFormat)` Returns the display name for the given currency in the given locale.
`String` | `getName(Locale locale, int nameStyle, boolean[] isChoiceFormat)` Returns the display name for the given currency in the given locale.
`String` | `getName(ULocale locale, int nameStyle, boolean[] isChoiceFormat)` Returns the display name for the given currency in the given locale.
`String` | `getName(ULocale locale, int nameStyle, String pluralCount, boolean[] isChoiceFormat)` Returns the display name for the given currency in the given locale.
`int` | `getNumericCode()` Returns the ISO 4217 numeric code for this currency object.
`double` | `getRoundingIncrement()` Returns the rounding increment for this currency, or 0.0 if no rounding is done by this currency.
`double` | `getRoundingIncrement(Currency.CurrencyUsage Usage)` Returns the rounding increment for this currency, or 0.0 if no rounding is done by this currency with the Usage.
`String` | `getSymbol()` Convenience and compatibility override of getName that requests the symbol name for the default `DISPLAY` locale.
`String` | `getSymbol(Locale loc)` Convenience and compatibility override of getName that requests the symbol name.
`String` | `getSymbol(ULocale uloc)` Convenience and compatibility override of getName that requests the symbol name.
`static boolean` | `isAvailable(String code, Date from, Date to)` Queries if the given ISO 4217 3-letter code is available on the specified date range.
`Currency` | `toJavaCurrency()` Returns a java.util.Currency object based on the currency represented by this Currency.
`String` | `toString()` Returns the ISO 4217 code for this currency.

### Inherited methods
From class `android.icu.util.MeasureUnit`
`boolean` | `equals(Object rhs)` Indicates whether some other object is "equal to" this one.
`static Set<MeasureUnit>` | `getAvailable()` Get all of the available units.
`static Set<MeasureUnit>` | `getAvailable(String type)` For the given type, return the available units.
`static Set<String>` | `getAvailableTypes()` Get all of the available units' types.
`String` | `getSubtype()` Get the subType, such as “foot”.
`String` | `getType()` Get the type, such as "length"
`int` | `hashCode()` Returns a hash code value for the object.
`String` | `toString()` Returns a string representation of the object.
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Constants

### LONG_NAME

    public static final int LONG_NAME

Selector for getName() indicating the long name for a currency, such as "US Dollar" for USD.

Constant Value: 1 (0x00000001)

### NARROW_SYMBOL_NAME

    public static final int NARROW_SYMBOL_NAME

Selector for getName() indicating the narrow currency symbol. The narrow currency symbol is similar to the regular currency symbol, but it always takes the shortest form: for example, "$" instead of "US$" for USD in en-CA.

Constant Value: 3 (0x00000003)

### PLURAL_LONG_NAME

    public static final int PLURAL_LONG_NAME

Selector for getName() indicating the plural long name for a currency, such as "US dollar" for USD in "1 US dollar", and "US dollars" for USD in "2 US dollars".

Constant Value: 2 (0x00000002)

### SYMBOL_NAME

    public static final int SYMBOL_NAME

Selector for getName() indicating a symbolic name for a currency, such as "$" for USD.

Constant Value: 0 (0x00000000)

## Protected constructors

### Currency

    protected Currency (String theISOCode)

Constructs a currency object for the given ISO 4217 3-letter code. This constructor assumes that the code is valid.

Parameters
`theISOCode` | `String`: The iso code used to construct the currency.

## Public methods

### fromJavaCurrency

    public static Currency fromJavaCurrency (Currency currency)

Returns a Currency object based on the currency represented by the given java.util.Currency.

Parameters
`currency` | `Currency`: The Java currency object to convert.

Returns
`Currency` | An equivalent ICU currency object.

### getAvailableCurrencies

    public static Set<Currency> getAvailableCurrencies ()

Returns the set of available currencies. The returned set of currencies contains all of the available currencies, including obsolete ones. The result set can be modified without affecting the available currencies in the runtime.

Returns
`Set<Currency>` | The set of available currencies. The returned set could be empty if there is no currency data available.

### getAvailableCurrencyCodes

    public static String[] getAvailableCurrencyCodes (ULocale loc,
                    Date d)

Returns an array of Strings which contain the currency identifiers that are valid for the given locale on the given date. If there are no such identifiers, returns null. Returned identifiers are in preference order.

Parameters
`loc` | `ULocale`: the locale for which to retrieve currency codes.
`d` | `Date`: the date for which to retrieve currency codes for the given locale.

Returns
`String[]` | The array of ISO currency codes.

### getAvailableCurrencyCodes

    public static String[] getAvailableCurrencyCodes (Locale loc,
                    Date d)

Returns an array of Strings which contain the currency identifiers that are valid for the given `Locale` on the given date. If there are no such identifiers, returns null. Returned identifiers are in preference order.

Parameters
`loc` | `Locale`: the `Locale` for which to retrieve currency codes.
`d` | `Date`: the date for which to retrieve currency codes for the given locale.

Returns
`String[]` | The array of ISO currency codes.

### getAvailableLocales

    public static Locale[] getAvailableLocales ()

Return an array of the locales for which a currency is defined.

Returns
`Locale[]` | an array of the available locales

### getAvailableULocales

    public static ULocale[] getAvailableULocales ()

Return an array of the ulocales for which a currency is defined.

Returns
`ULocale[]` | an array of the available ulocales

### getCurrencyCode

    public String getCurrencyCode ()

Returns the ISO 4217 3-letter code for this currency object.

Returns
`String` |

### getDefaultFractionDigits

    public int getDefaultFractionDigits ()

Returns the number of the number of fraction digits that should be displayed for this currency. This is equivalent to getDefaultFractionDigits(CurrencyUsage.STANDARD); Important: The number of fraction digits for a given currency is NOT guaranteed to be constant across versions of ICU or CLDR. For example, do NOT use this value as a mechanism for deciding the magnitude used to store currency values in a database. You should use this value for display purposes only.

Returns
`int` | a non-negative number of fraction digits to be displayed

### getDefaultFractionDigits

    public int getDefaultFractionDigits (Currency.CurrencyUsage Usage)

Returns the number of the number of fraction digits that should be displayed for this currency with Usage. Important: The number of fraction digits for a given currency is NOT guaranteed to be constant across versions of ICU or CLDR. For example, do NOT use this value as a mechanism for deciding the magnitude used to store currency values in a database. You should use this value for display purposes only.

Parameters
`Usage` | `Currency.CurrencyUsage`: the usage of currency(Standard or Cash)

Returns
`int` | a non-negative number of fraction digits to be displayed

### getDisplayName

    public String getDisplayName ()

Returns the display name for this currency in the default locale. If the resource data for the default locale contains no entry for this currency, then the ISO 4217 code is returned.

Note: This method is a convenience equivalent for `Currency.getDisplayName()` and is equivalent to `getName(Locale.getDefault(), LONG_NAME, null)`.

Returns
`String` | The display name of this currency

See also:

- `getDisplayName(Locale)`
- `getName(Locale, int, boolean[])`

### getDisplayName

    public String getDisplayName (Locale locale)

Returns the display name for this currency in the given locale. If the resource data for the given locale contains no entry for this currency, then the ISO 4217 code is returned.

Note: This method is a convenience equivalent for `Currency.getDisplayName(java.util.Locale)` and is equivalent to `getName(locale, LONG_NAME, null)`.

Parameters
`locale` | `Locale`: locale in which to display currency

Returns
`String` | The display name of this currency for the specified locale

See also:

- `getDisplayName(Locale)`
- `getName(Locale, int, boolean[])`

### getInstance

    public static Currency getInstance (String theISOCode)

Returns a currency object given an ISO 4217 3-letter code.

Parameters
`theISOCode` | `String`: the iso code

Returns
`Currency` | the currency for this iso code

Throws
`NullPointerException` | if `theISOCode` is null.
`IllegalArgumentException` | if `theISOCode` is not a 3-letter alpha code.

### getInstance

    public static Currency getInstance (Locale locale)

Returns a currency object for the default currency in the given locale.

Parameters
`locale` | `Locale`: the locale

Returns
`Currency` | the currency object for this locale

### getInstance

    public static Currency getInstance (ULocale locale)

Returns a currency object for the default currency in the given locale.

Parameters
`locale` | `ULocale`

Returns
`Currency` |

### getKeywordValuesForLocale

    public static final String[] getKeywordValuesForLocale (String key,
                    ULocale locale,
                    boolean commonlyUsed)

Given a key and a locale, returns an array of values for the key for which data exists. If commonlyUsed is true, these are the values that typically are used with this locale, otherwise these are all values for which data exists. This is a common service API.

The only supported key is "currency", other values return an empty array.

Currency information is based on the region of the locale. If the locale does not indicate a region, `ULocale#addLikelySubtags(ULocale)` is used to infer a region, except for the 'und' locale.

If commonlyUsed is true, only the currencies known to be in use as of the current date are returned. When there are more than one, these are returned in preference order (typically, this occurs when a country is transitioning to a new currency, and the newer currency is preferred), see Unicode TR#35 Sec. C1. If commonlyUsed is false, all currencies ever used in any locale are returned, in no particular order.

Parameters
`key` | `String`: key whose values to look up. the only recognized key is "currency"
`locale` | `ULocale`: the locale
`commonlyUsed` | `boolean`: if true, return only values that are currently used in the locale. Otherwise returns all values.

Returns
`String[]` | an array of values for the given key and the locale. If there is no data, the array will be empty.

### getName

    public String getName (Locale locale,
                    int nameStyle,
                    String pluralCount,
                    boolean[] isChoiceFormat)

Returns the display name for the given currency in the given locale. This is a convenience overload of getName(ULocale, int, String, boolean[]);

Parameters
`locale` | `Locale`: locale in which to display currency
`nameStyle` | `int`: selector for which kind of name to return
`pluralCount` | `String`: plural count string for this locale
`isChoiceFormat` | `boolean`: isChoiceFormat[0] is always set to false, or isChoiceFormat can be null; display names are static strings; since ICU 4.4, ChoiceFormat patterns are no longer supported

Returns
`String` | display string for this currency. If the resource data contains no entry for this currency, then the ISO 4217 code is returned.

### getName

    public String getName (Locale locale,
                    int nameStyle,
                    boolean[] isChoiceFormat)

Returns the display name for the given currency in the given locale. This is a convenient method for getName(ULocale, int, boolean[]);

Parameters
`locale` | `Locale`: locale in which to display currency
`nameStyle` | `int`: selector for which kind of name to return. The nameStyle should be SYMBOL_NAME, NARROW_SYMBOL_NAME, or LONG_NAME. Otherwise, throw IllegalArgumentException.
`isChoiceFormat` | `boolean`: isChoiceFormat[0] is always set to false, or isChoiceFormat can be null; display names are static strings; since ICU 4.4, ChoiceFormat patterns are no longer supported

Returns
`String` | display string for this currency. If the resource data contains no entry for this currency, then the ISO 4217 code is returned.

### getName

    public String getName (ULocale locale,
                    int nameStyle,
                    boolean[] isChoiceFormat)

Returns the display name for the given currency in the given locale. For example, the display name for the USD currency object in the en_US locale is "$".

Parameters
`locale` | `ULocale`: locale in which to display currency
`nameStyle` | `int`: selector for which kind of name to return. The nameStyle should be SYMBOL_NAME, NARROW_SYMBOL_NAME, or LONG_NAME. Otherwise, throw IllegalArgumentException.
`isChoiceFormat` | `boolean`: isChoiceFormat[0] is always set to false, or isChoiceFormat can be null; display names are static strings; since ICU 4.4, ChoiceFormat patterns are no longer supported

Returns
`String` | display string for this currency. If the resource data contains no entry for this currency, then the ISO 4217 code is returned.

Throws
`IllegalArgumentException` | if the nameStyle is not SYMBOL_NAME or LONG_NAME.

See also:

- `getName(ULocale, int, String, boolean[])`

### getName

    public String getName (ULocale locale,
                    int nameStyle,
                    String pluralCount,
                    boolean[] isChoiceFormat)

Returns the display name for the given currency in the given locale. For example, the SYMBOL_NAME for the USD currency object in the en_US locale is "$". The PLURAL_LONG_NAME for the USD currency object when the currency amount is plural is "US dollars", such as in "3.00 US dollars"; while the PLURAL_LONG_NAME for the USD currency object when the currency amount is singular is "US dollar", such as in "1.00 US dollar".

Parameters
`locale` | `ULocale`: locale in which to display currency
`nameStyle` | `int`: selector for which kind of name to return
`pluralCount` | `String`: plural count string for this locale
`isChoiceFormat` | `boolean`: isChoiceFormat[0] is always set to false, or isChoiceFormat can be null; display names are static strings; since ICU 4.4, ChoiceFormat patterns are no longer supported

Returns
`String` | display string for this currency. If the resource data contains no entry for this currency, then the ISO 4217 code is returned.

Throws
`IllegalArgumentException` | if the nameStyle is not SYMBOL_NAME, LONG_NAME, or PLURAL_LONG_NAME.

### getNumericCode

    public int getNumericCode ()

Returns the ISO 4217 numeric code for this currency object.

Note: If the ISO 4217 numeric code is not assigned for the currency or the currency is unknown, this method returns 0.

Returns
`int` | The ISO 4217 numeric code of this currency.

### getRoundingIncrement

    public double getRoundingIncrement ()

Returns the rounding increment for this currency, or 0.0 if no rounding is done by this currency. This is equivalent to getRoundingIncrement(CurrencyUsage.STANDARD);

Returns
`double` | the non-negative rounding increment, or 0.0 if none

### getRoundingIncrement

    public double getRoundingIncrement (Currency.CurrencyUsage Usage)

Returns the rounding increment for this currency, or 0.0 if no rounding is done by this currency with the Usage.

Parameters
`Usage` | `Currency.CurrencyUsage`: the usage of currency(Standard or Cash)

Returns
`double` | the non-negative rounding increment, or 0.0 if none

### getSymbol

    public String getSymbol ()

Convenience and compatibility override of getName that requests the symbol name for the default `DISPLAY` locale.

Returns
`String` |

See also:

- `getName(ULocale, int, boolean[])`
- `ULocale.Category.DISPLAY`

### getSymbol

    public String getSymbol (Locale loc)

Convenience and compatibility override of getName that requests the symbol name.

Parameters
`loc` | `Locale`: the Locale for the symbol

Returns
`String` |

See also:

- `getName(ULocale, int, boolean[])`

### getSymbol

    public String getSymbol (ULocale uloc)

Convenience and compatibility override of getName that requests the symbol name.

Parameters
`uloc` | `ULocale`: the ULocale for the symbol

Returns
`String` |

See also:

- `getName(ULocale, int, boolean[])`

### isAvailable

    public static boolean isAvailable (String code,
                    Date from,
                    Date to)

Queries if the given ISO 4217 3-letter code is available on the specified date range.

Note: For checking availability of a currency on a specific date, specify the date on both `from` and `to`. When both `from` and `to` are null, this method checks if the specified currency is available all time.

Parameters
`code` | `String`: The ISO 4217 3-letter code.
`from` | `Date`: The lower bound of the date range, inclusive. When `from` is null, check the availability of the currency any date before `to`
`to` | `Date`: The upper bound of the date range, inclusive. When `to` is null, check the availability of the currency any date after `from`

Returns
`boolean` | true if the given ISO 4217 3-letter code is supported on the specified date range.

Throws
`IllegalArgumentException` | when `to` is before `from`.

### toJavaCurrency

    public Currency toJavaCurrency ()

Returns a java.util.Currency object based on the currency represented by this Currency.

Returns
`Currency` | An equivalent Java currency object.

### toString

    public String toString ()

Returns the ISO 4217 code for this currency.

Returns
`String` | a string representation of the object.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*