Functional Weave
Code in Rust

money.apply-rate@1.0.1

README.md

388 bytes · view raw

# money.apply-rate

Rates are integers in basis points, never floats. A VAT rate of 20% is 2000, not
0.2, so the calculation stays in exact integer arithmetic from input to rounded
result.

This single function covers VAT, discounts, interest, commission and service
charges: they differ in the rate and the rounding policy, not in the arithmetic.

1.0.1 adds tests; behaviour unchanged.