Package codes-iso-4217
This package contains an implementation of the ISO 4217 Currency Codes specification.
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
use ;
let code = BZD;
assert_eq!;
assert_eq!;
// feature = "currency_name"
assert_eq!;
// feature = "country_name"
assert_eq!;
// feature = "monetary_units"
assert_eq!;
// feature = "is_fund"
assert_eq!;
// feature = "historical_codes"
assert_eq!;
assert_eq!;
// feature = "symbols"
assert_eq!;
assert_eq!;
assert_eq!;
Features
By default only the serde feature is enabled, the CurrencyCode::alpha_code and
CurrencyCode::numeric_code methods cannot be excluded.
serde- Enables serialization of theCurrencyCodetype.currency_name- Adds theCurrencyCode::currency_namemethod.country_name- Adds theCurrencyCode::country_namemethod.monetary_units- Adds theCurrencyCode::monetary_unitsmethod.is_fund- Adds theCurrencyCode::is_fundmethod.historical_codes- Adds theCurrencyCode::is_historicalandCurrencyCode::withdrawal_datemethods.symbols- Adds theCurrencyCode::currency_symbol_strandCurrencyCode::currency_symbol_code_pointsmethods.
Changes
Version 0.1.7
- Catering for new
buildmodule in codes-common
Version 0.1.6
- Implemented
StandardizedandFixedLengthCodetraits.
Version 0.1.5
- Added symbols, scraped from xe.com
- Synced the examples, with commented out lines for feature-gated methods.
Version 0.1.4
- Added
ALL_CODESconstant.
Version 0.1.3
- Clean-up implementation based on newer
codes-common - Using new
Codetrait and macro-created implementation.
Version 0.1.2
- Added more documentation.
- Removed the implementation of the
Codetrait. - Changed error type to enum from struct.
Version 0.1.1
- Completed the build-time work to generate the
CurrencyCodetype and methods. Took heavy inspiration from penny but wanted a different resulting style.
Version 0.1.0
- Initial place-holder release.
TODO
- Create a scheduled build that retrieves updated files from the ISO site.