use-amount
Decimal-safe scaled integer amount primitives for RustUse finance crates.
use-amount stores financial amounts as integer minor units plus a decimal scale. It avoids f32 and f64 entirely.
Example
use Amount;
let invoice = from_minor_units?;
let payment = from_minor_units?;
let balance = invoice.checked_sub?;
assert_eq!;
assert_eq!;
# Ok::
Scope
Use this crate for scaled integer amount values, checked same-scale arithmetic, sign checks, rescaling, normalization, and formatting. It does not model currencies, money, exchange rates, taxes, or rounding policy engines.
License
Licensed under either MIT or Apache-2.0.