[−][src]Crate iso_currency
ISO 4217 currency codes
This crate provides an enum that represents all ISO 4217 currencies and has simple methods to convert between numeric and character code, list of territories where each currency is used, the symbol, and the English name of the currency.
The data for this is taken from https://en.wikipedia.org/wiki/ISO_4217
The Country
enum is re-exported from the only dependency - the iso_country crate.
Examples
use iso_currency::{Currency, Country}; assert_eq!(Currency::EUR.name(), "Euro"); assert_eq!(Currency::EUR.numeric(), 978); assert_eq!(Currency::from_numeric(978), Some(Currency::EUR)); assert_eq!(Currency::from_code("EUR"), Some(Currency::EUR)); assert_eq!(Currency::CHF.used_by(), vec![Country::LI, Country::CH]); assert_eq!(format!("{}", Currency::EUR.symbol()), "€"); assert_eq!(Currency::EUR.subunit_fraction(), Some(100));
Structs
CurrencySymbol |
Enums
Country | |
Currency |