Cash rounding belongs at the payment boundary. Working in cents makes a five-cent increment easier to reason about.
Worked example
const cents = 1483;
console.log(Math.round(cents / 5) * 5);Result
1485Implementation notes
Cash rounding and line-item tax rounding can produce different totals. Specify whether you round the final payable amount or each individual entry.
Try it yourself
Check totals one, two and three cents above an exact nickel.
Open the JavaScript example →Editorial date July 27, 2026 · Published December 6, 2026