Functional Weave
Code in TypeScript

money.amount@1.0.2

README.md

414 bytes · view raw

# money.amount

Money is never a float. 0.1 + 0.2 is not 0.3 in binary floating point, and an
invoice that is a penny out is a support ticket.

Amounts are integers in the currency's minor unit, tagged with the currency so
that adding GBP to EUR fails loudly rather than silently producing a number.

1.0.1 adds tests; behaviour unchanged.

1.0.2 fixes Python accepting a trailing newline in currency; adds tests.