#iso #currency #code

iso-4217

Currency code based on ISO-4217

1 unstable release

0.1.0 Mar 3, 2020

#237 in Finance

Download history 499/week @ 2024-10-30 391/week @ 2024-11-06 417/week @ 2024-11-13 342/week @ 2024-11-20 384/week @ 2024-11-27 421/week @ 2024-12-04 438/week @ 2024-12-11 563/week @ 2024-12-18 344/week @ 2024-12-25 323/week @ 2025-01-01 382/week @ 2025-01-08 983/week @ 2025-01-15 387/week @ 2025-01-22 745/week @ 2025-01-29 523/week @ 2025-02-05 693/week @ 2025-02-12

2,649 downloads per month
Used in 6 crates (2 directly)

MIT/Apache

21KB
301 lines

iso-4217

CI Rust Documentation Latest Version

This library provides enumeration of ISO-4217.

[dependencies]
iso-4217 = "0.1"

Example

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");

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.


lib.rs:

This library provides enumeration of ISO-4217.

Example

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");

No runtime deps