#iso #currency #code

iso-4217

Currency code based on ISO-4217

1 unstable release

0.1.0 Mar 3, 2020

#251 in Finance

Download history 318/week @ 2024-11-17 421/week @ 2024-11-24 365/week @ 2024-12-01 417/week @ 2024-12-08 637/week @ 2024-12-15 397/week @ 2024-12-22 190/week @ 2024-12-29 467/week @ 2025-01-05 530/week @ 2025-01-12 775/week @ 2025-01-19 494/week @ 2025-01-26 660/week @ 2025-02-02 703/week @ 2025-02-09 722/week @ 2025-02-16 873/week @ 2025-02-23 1442/week @ 2025-03-02

3,788 downloads per month
Used in 3 crates (via baseunits-rs)

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