money

Exact money as integer minor units: ISO 4217 currencies, named rounding, allocation that sums to the input, and fixed-point rates.

Built and tested in the harness, and not in the public repository yet. The install line and the source link appear here when it is.

What it is

money.

Exact money with no float anywhere. An Amount is an integer count of minor units in its currency’s own exponent (JPY 0, EUR 2, BHD 3, CLF 4). Every fallible operation returns a Result: mixing currencies, overflow and malformed input are errors, and nothing panics or wraps. Multiplying by a fixed-point Rate always names its rounding mode. allocate splits an amount so the parts sum to the input exactly. The currency table is refreshed by hand from ISO 4217 data, and the crypto Cargo feature is a reserved, empty slot.

From the crate’s own README.

History

Changelog.

Not released yet. Its changelog starts with its first release.

One of 95 crates in the harness, all of them MIT.