A money data type, for easy and safe handling of currency amounts
To use this package, run the following command in your project's root directory:
Put the following dependency into your project's dependences section:
Provide a money data type, for easy and safe handling of currency amounts.
Floating point is imprecise. Integer is fragile. Both lack convenience, e.g. for rounding.
- support different rounding modes
- cannot mix currencies (e.g. EUR vs USD)
- efficient (faster than BigNum)
- overflow checking for arithmetic
Scope is smaller than JSR 354, for example,
which also considers conversion and meta data.
A conversion rate depends on target date and time,
the currencies involved, the provider, the amount, and other factors.
If you need meta data,
money into your own data type.
Internally, this uses a
long data type.
This limits the numbers depending on the number of decimals specified.
money!"EUR" type has a max of
roughly 922 trillion.
- Registered by qznc
- 0.1.0 released 5 years ago
- Copyright © 2016, Andreas Zwinkau