Crates.io | iso-4217 |
lib.rs | iso-4217 |
version | 0.1.0 |
source | src |
created_at | 2020-03-03 16:40:12.176175 |
updated_at | 2020-03-03 16:40:12.176175 |
description | Currency code based on ISO-4217 |
homepage | |
repository | https://github.com/mechiru/iso-4217 |
max_upload_size | |
id | 215005 |
size | 37,792 |
This library provides enumeration of ISO-4217.
[dependencies]
iso-4217 = "0.1"
use std::convert::TryFrom;
use iso_4217::*;
let usd: CurrencyCode = TryFrom::try_from("USD").unwrap();
assert_eq!(usd, CurrencyCode::USD);
assert_eq!(usd.alpha(), "USD");
assert_eq!(usd.num(), 840);
assert_eq!(usd.digit(), Some(2));
assert_eq!(usd.name(), "United States dollar");
Licensed under either of Apache License, Version 2.0 or MIT license at your option.