Package codes-iso-4217

This package contains an implementation of the ISO 4217 Currency Codes specification.

crates.io docs.rs

This standard establishes internationally recognized codes for the representation of currencies that enable clarity and reduce errors. Currencies are represented both numerically and alphabetically, using either three digits or three letters. Some of the alphabetic codes for major currencies are familiar, such as "EUR" for Euros. Fortunately, ISO 4217 covers everything from Afghanis to Zambian Kwacha as well.

This package extends the data model of the ISO specification by adding a currency symbol string (and Unicode code points for the symbol) where possible to all symbols.

For notes on the design of the API, see the repository README.

Example

```rust use codesiso4217::{CurrencyCode, ISO_4217};

let code = CurrencyCode::BZD;

asserteq!(code.alphacode(), "BZD"); asserteq!(code.numericcode(), Some(84));

// feature = "currencyname" asserteq!(code.currency_name(), "Belize Dollar");

// feature = "countryname" asserteq!(code.country_name(), "BELIZE");

// feature = "monetaryunits" asserteq!(code.monetary_units(), 2);

// feature = "isfund" asserteq!(code.is_fund(), false);

// feature = "historicalcodes" asserteq!(code.ishistorical(), false); asserteq!(code.withdrawal_date(), None);

// feature = "symbols" asserteq!(code.currencysymbolstr(), Some("BZ$")); asserteq!(code.currencysymbolcode_points(), Some(&[0x42, 0x5a, 0x24]));

asserteq!(ISO4217.title(), "Currency codes"); ```

Features

By default only the serde feature is enabled, the CurrencyCode::alpha_code and CurrencyCode::numeric_code methods cannot be excluded.

Changes

Version 0.1.7

Version 0.1.6

Version 0.1.5

Version 0.1.4

Version 0.1.3

Version 0.1.2

Version 0.1.1

Version 0.1.0

TODO

  1. Create a scheduled build that retrieves updated files from the ISO site.