steel-cent, currency and money values for Rust

# steel-cent

A crate providing currency and money values for Rust

## Features

- A value type for currencies
- Two value types for monetary amounts
- Customizable formatting of money values
- Currency lookup by ISO 4217 alpha (e.g., "USD") or numeric (e.g, 840) codes

## Example

    use steel_cent::Money;
    use steel_cent::currency::USD;
    use steel_cent::formatting::{STYLE_US, STYLE_UK, STYLE_FRANCE};

    let price = Money::of_major_minor(USD, 19, 95);
    let shipping_and_handling = Money::of_major(USD, 10);
    let convenience_charge = Money::of_major(USD, 6);
    let fees = shipping_and_handling + convenience_charge;
    let discount: f64 = 1.0 - 0.2; // 20% off
    let discounted_price = price * discount;
    let total = discounted_price + fees;

    assert_eq!(Money::of_major_minor(USD, 15, 96), discounted_price);
    assert_eq!(Money::of_major_minor(USD, 31, 96), total);
    assert_eq!((price * discount) + shipping_and_handling + convenience_charge,
               total);

    assert_eq!("total: $31.96",
               format!("total: {}", STYLE_US.display_for(&total)));
    assert_eq!("total: USD31.96",
               format!("total: {}", STYLE_UK.display_for(&total)));
    assert_eq!("total: 31,96\u{a0}USD",
               format!("total: {}", STYLE_FRANCE.display_for(&total)));