3 releases

Uses old Rust 2015

0.3.2 Jul 22, 2018
0.3.1 Jun 28, 2018
0.2.0 Nov 4, 2016
0.1.1 Sep 19, 2016
0.1.0 Jan 11, 2016

#107 in Finance

Download history 178/week @ 2023-11-20 124/week @ 2023-11-27 72/week @ 2023-12-04 182/week @ 2023-12-11 107/week @ 2023-12-18 55/week @ 2023-12-25 86/week @ 2024-01-01 124/week @ 2024-01-08 215/week @ 2024-01-15 354/week @ 2024-01-22 148/week @ 2024-01-29 240/week @ 2024-02-05 123/week @ 2024-02-12 99/week @ 2024-02-19 211/week @ 2024-02-26 145/week @ 2024-03-04

585 downloads per month
Used in 5 crates (4 directly)

ISC license

34KB
1.5K SLoC

ci-badge license-badge

iso4217.rs

Rust crate for ISO 4217 data.

ISO 4217

ISO 4217 is a standard published by the International Organization for Standardization, which delineates currency designators, country codes (alpha and numeric), and references to minor units in three tables.

-- Wikipedia

Installation

Add the following dependency to your Cargo.toml:

iso4217 = "0.3"

And include it in your project:

extern crate iso4217;

Examples

Retrieve all currencies defined by ISO 4217:

extern crate iso4217;

fn main() {
    let currencies = iso4217::all().unwrap();
}

Retrieve a currency by its alpha3 code:

extern crate iso4217;

fn main() {
    let currency = iso4217::alpha3("EUR").unwrap();
}

Retrieve a vector of currencies used by a country, given an alpha2 code specified by ISO 3166:

extern crate iso4217;

fn main() {
    let currencies = iso4217::country("SG").unwrap();
}

Retrieve a vector of currencies with a certain exponential value (decimal places):

extern crate iso4217;

fn main() {
    let currencies = iso4217::exp(2).unwrap();
}

Retrieve by the full name of the currency:

extern crate iso4217;

fn main() {
    let currency = iso4217::name("Turkish lira").unwrap();
}

Retrieve by the 3-digit numeric representation of the currency:

extern crate iso4217;

fn main() {
    let currency = iso4217::num("840").unwrap();
}

License

License info in LICENSE.md. Long story short, ISC.

No runtime deps