use-currency-code 0.1.0

Small ISO 4217-style currency code primitives for RustUse
Documentation
  • Coverage
  • 100%
    9 out of 9 items documented1 out of 8 items with examples
  • Size
  • Source code size: 5.93 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 363.19 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 6s Average build duration of successful builds.
  • all releases: 6s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-locale
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-currency-code

Small ISO 4217-style currency code primitives for RustUse.

Example

use use_currency_code::{is_currency_code, parse_currency_code};

let currency = parse_currency_code("usd").unwrap();

assert_eq!(currency.as_str(), "USD");
assert!(is_currency_code("EUR"));

Scope

  • Validate 3-letter alphabetic currency code shapes.
  • Normalize currency code identifiers to uppercase.
  • Provide a small CurrencyCode newtype for validated currency identifiers.

Non-goals

  • Exchange rates.
  • Money arithmetic.
  • Decimal formatting.
  • Live currency metadata downloads.
  • Finance APIs.

License

Licensed under either of the following, at your option:

  • Apache License, Version 2.0
  • MIT license