Functional Weave
Code in Python

money.apply-rate@1.0.0

README.md

348 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.