#[non_exhaustive]pub enum Currency {
Show 44 variants
AED,
ARS,
AUD,
BRL,
CAD,
CHF,
CLP,
CNY,
COP,
CRC,
DINAR,
DOLLAR,
DZD,
EUR,
GBP,
HKD,
IDR,
ILS,
INR,
JPY,
KRW,
KWD,
KZT,
MXN,
MYR,
NOK,
NZD,
PEN,
PESO,
PHP,
PLN,
QAR,
RIYAL,
RUB,
SAR,
SGD,
THB,
TRY,
TWD,
UAH,
USD,
UYU,
VND,
ZAR,
}Expand description
Defines currencies
Every three-letter variant is a valid ISO 4217 currency code. The only
exceptions are DINAR, DOLLAR, PESO and RIYAL, which are generic
terminology for the respective currencies.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AED
Dirham
ARS
Argentine peso
AUD
Australian dollar
BRL
Brazilian real
CAD
Canadian dollar
CHF
Swiss franc
CLP
Chilean peso
CNY
Chinese yuan
COP
Colombian peso
CRC
Costa Rican colón
DINAR
Dinar
DOLLAR
Dollar
DZD
Algerian dinar
EUR
Euro
GBP
British pound
HKD
Hong Kong dollar
IDR
Indonesian rupiah
ILS
Israeli new shekel
INR
Indian rupee
JPY
Japanese yen
KRW
South Korean won
KWD
Kuwaiti dinar
KZT
Kazakhstani tenge
MXN
Mexican peso
MYR
Malaysian ringgit
NOK
Norwegian krone
NZD
New Zealand dollar
PEN
Peruvian sol
PESO
Peso
PHP
Philippine peso
PLN
Polish zloty
QAR
Qatari riyal
RIYAL
Riyal
RUB
Russian ruble
SAR
Saudi riyal
SGD
Singapore dollar
THB
Thai baht
TRY
Turkish lira
TWD
Taiwan dollar
UAH
Ukrainian hryvnia
USD
US dollar
UYU
Uruguayan peso
VND
Vietnamese dong
ZAR
South African rand
Implementations§
Source§impl Currency
impl Currency
Sourcepub fn default_string(&self, plural_form: bool) -> String
pub fn default_string(&self, plural_form: bool) -> String
Returns a default string representation for the currency
Since many languages share the same work for a specific currency (like euro), it is easier and wiser for modularity to have a default value.
Sourcepub fn default_subunit_string(&self, cent: &str, plural_form: bool) -> String
pub fn default_subunit_string(&self, cent: &str, plural_form: bool) -> String
Returns a default string representation for the cents of the currency