Enum iso_currency::Currency [−][src]
pub enum Currency {}Show 179 variants
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BOV, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHE, CHF, CHW, CLF, CLP, CNY, COP, COU, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MXV, 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, SLL, SOS, SRD, SSP, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USN, UYI, UYU, UYW, UZS, VES, VND, VUV, WST, XAF, XAG, XAU, XBA, XBB, XBC, XBD, XCD, XDR, XOF, XPD, XPF, XPT, XSU, XTS, XUA, XXX, YER, ZAR, ZMW, ZWL,
Variants
Implementations
Returns the numeric code of the currency
This method will return the ISO 4217 numeric code of the currency
Example
use iso_currency::Currency; assert_eq!(Currency::EUR.numeric(), 978);
Returns the name of the currency in English
This method will return the English name of the currency
Example
use iso_currency::Currency; assert_eq!(Currency::EUR.name(), "Euro");
Returns the ISO 4217 code
Example
use iso_currency::Currency; assert_eq!(Currency::EUR.code(), "EUR");
Returns a list of locations which use the currency
This method will return a list of locations which use the currency. The use is non-exclusive, so it might mean that the location is using other currencies as well. The list of locations is sorted.
Example
use iso_currency::{Currency, Country}; assert_eq!( Currency::CHF.used_by(), vec![Country::LI, Country::CH] );
Returns the currency’s symbol
This method will return the symbol commonly used to represent the currency. In case there is no symbol associated the international currency symbol will be returned.
Example
use iso_currency::Currency; assert_eq!(format!("{}", Currency::EUR.symbol()), "€"); assert_eq!(format!("{}", Currency::XXX.symbol()), "¤");
Create a currency instance from a ISO 4217 character code
Example
use iso_currency::Currency; assert_eq!(Currency::from_code("EUR"), Some(Currency::EUR));
Create a currency instance from a ISO 4217 numeric code
Example
use iso_currency::Currency; assert_eq!(Currency::from_numeric(978), Some(Currency::EUR));
Returns how many of the subunits equal the main unit of the currency For example there are a 100 cents in 1 Euro so this will return Some(100) for EUR.
This returns an optional value because some currencies don’t have a subunit.
Example
use iso_currency::Currency; assert_eq!(Currency::EUR.subunit_fraction(), Some(100));
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Currency
impl UnwindSafe for Currency
Blanket Implementations
Mutably borrows from an owned value. Read more