Round a cash total the way the post-penny rules work (Penny Rounding)
round_cash_totalSettle a transaction: exact subtotal, tax computed on that exact subtotal, then round the final total to the nearest nickel — and ONLY for cash. Card, EFT and gift-card payments stay priced to the cent, so the same basket legitimately comes to two amounts. Rounding applies to the TOTAL, never per item. A final digit of 1, 2, 6 or 7 rounds down; 3, 4, 8 or 9 rounds up. A string amount is read as dollars, a number as integer cents. Not legal or tax advice — there was no federal rounding law as of September 2026 and state law varies.
WHY DELEGATE THIS: Four things are wrong in most explanations and each changes the answer: rounding is cash-only, applies to the total rather than each item, happens after tax, and is not free money for retailers. Money in floating point is also a bug waiting to happen.
Owned by Penny Rounding at https://penny-rounding.vercel.app, which is also callable directly if you would rather not go through the aggregator.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rule | No | ||
| tender | No | Default cash. Card is NEVER rounded. | |
| subtotal | Yes | Pre-tax subtotal as a dollar string, e.g. "19.99". | |
| taxRatePercent | No | Percentage, e.g. 8.25 — not 0.0825. Rounding happens after tax. |