Scale by a factor (VAT, discount, exchange rate). The result is rounded to a
minor unit with round; Math.round is half-up toward +infinity, which is
what most invoices expect. Pass Math.floor / Math.ceil or your own for
other policies. For splitting an amount into parts use allocate, which
never loses a minor unit.
Scale by a factor (VAT, discount, exchange rate). The result is rounded to a minor unit with
round; Math.round is half-up toward +infinity, which is what most invoices expect. Pass Math.floor / Math.ceil or your own for other policies. For splitting an amount into parts useallocate, which never loses a minor unit.