money 0.1.0

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:

Manual usage
Put the following dependency into your project's dependences section:

D-Money

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.

Features:

  • 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, then wrap money into your own data type.

Internally, this uses a long data type. This limits the numbers depending on the number of decimals specified. A plain money!"EUR" type has a max of 922337203685477.5807EUR, roughly 922 trillion.

Authors:
  • Andreas Zwinkau <qznc@web.de>
Dependencies:
none
Versions:
3.0.1 2020-Jun-08
3.0.0 2020-Jun-06
2.5.0 2020-May-29
2.4.0 2020-May-28
2.3.1 2019-Apr-25
Show all 13 versions
Download Stats:
  • 14 downloads today

  • 81 downloads this week

  • 687 downloads this month

  • 13934 downloads total

Score:
2.9
Short URL:
money.dub.pm