Crate steel_cent [−] [src]
Currency and money values for Rust, plus customizable formatting of money values and reference data for real-world currencies.
Money and SmallMoney
The crate provides two representations of an amount of money in a certain currency, both of which have similar implementations and feature similar behavior. They internally represent their amounts as an integer of the "minor" unit of their currency. For example a US-Dollar amount is stored as an integer number of cents.
The starting point for most uses should probably be Money
. The range of values it can
represent should be large enough for almost all uses.
SmallMoney
is only 64 bits in size, which might be nice from a performance perspective, but
the range of values it can represent is quite limited. See the doc tests of min
and max
for details.
Reexports
pub use currency::Currency; |
Modules
currency |
Besides defining the |
formatting |
Support for formatting of monetary values. |
Structs
Money |
A signed amount of money in a certain currency. |
SmallMoney |
A 64-bit-sized, signed amount of money in a certain currency. |