Enum Class CurrencyCode
- All Implemented Interfaces:
Serializable,Comparable<CurrencyCode>,Constable
ISO 4217 currency codes with representative locales.
Each constant provides the ISO code and a locale used for
formatting. Use format(double) or format(double, boolean)
to format amounts directly.
- API Note:
- This enum is immutable and thread-safe.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionformat(double amount) Format an amount using this currency's locale conventions.format(double amount, boolean rounded) Format an amount using this currency's locale conventions.static Optional<CurrencyCode>Look up a currency by ISO code.getCode()static CurrencyCodeReturns the enum constant of this class with the specified name.static CurrencyCode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AED
-
AFN
-
ALL
-
AMD
-
ANG
-
AOA
-
ARS
-
AUD
-
AWG
-
AZN
-
BAM
-
BBD
-
BDT
-
BGN
-
BHD
-
BIF
-
BMD
-
BND
-
BOB
-
BRL
-
BSD
-
BTN
-
BWP
-
BYN
-
BZD
-
CAD
-
CDF
-
CHF
-
CLP
-
CNY
-
COP
-
CRC
-
CUP
-
CVE
-
CZK
-
DJF
-
DKK
-
DOP
-
DZD
-
EGP
-
ERN
-
ETB
-
EUR
-
FJD
-
FKP
-
GBP
-
GEL
-
GGP
-
GHS
-
GIP
-
GMD
-
GNF
-
GTQ
-
GYD
-
HKD
-
HNL
-
HTG
-
HUF
-
IDR
-
ILS
-
IMP
-
INR
-
IQD
-
IRR
-
ISK
-
JEP
-
JMD
-
JOD
-
JPY
-
KES
-
KGS
-
KHR
-
KMF
-
KRW
-
KWD
-
KYD
-
KZT
-
LAK
-
LBP
-
LKR
-
LRD
-
LSL
-
LYD
-
MAD
-
MDL
-
MGA
-
MKD
-
MMK
-
MNT
-
MOP
-
MRU
-
MUR
-
MVR
-
MWK
-
MXN
-
MYR
-
MZN
-
NAD
-
NGN
-
NIO
-
NOK
-
NPR
-
NZD
-
OMR
-
PAB
-
PEN
-
PGK
-
PHP
-
PKR
-
PLN
-
PYG
-
QAR
-
RON
-
RSD
-
RUB
-
RWF
-
SAR
-
SBD
-
SCR
-
SDG
-
SEK
-
SGD
-
SHP
-
SLE
-
SOS
-
SRD
-
SSP
-
STN
-
SVC
-
SYP
-
SZL
-
THB
-
TJS
-
TMT
-
TND
-
TOP
-
TRY
-
TTD
-
TWD
-
TZS
-
UAH
-
UGX
-
USD
-
UYU
-
UZS
-
VES
-
VND
-
VUV
-
WST
-
XAF
-
XAG
-
XAU
-
XCD
-
XCG
-
XOF
-
XPD
-
XPF
-
XPT
-
YER
-
ZAR
-
ZMW
-
ZWG
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
fromCode
Look up a currency by ISO code.- Parameters:
code- ISO 4217 code, case-insensitive- Returns:
- Optional containing the currency if found
-
format
Format an amount using this currency's locale conventions. -
format
Format an amount using this currency's locale conventions.- Parameters:
rounded- true to round to default fraction digits- See Also:
-
getCode
- Returns:
- the ISO 4217 currency code
-
getLocale
- Returns:
- the representative locale for formatting
-
toCurrency
- Returns:
- the
Currencyinstance, if available
-