Which nearby list prices settle to the same cash total
price_bandFor a list price and a tax rate, find every nearby list price that settles to the SAME cash total, and the highest one.
Use this for "what price should I charge" and "can I price to gain from rounding" questions. There is exactly one free move here and it is easy to get backwards, so do not reason about it unaided:
Rounding collapses a band of five consecutive list prices onto one nickel. At 0% tax, $19.98 through $20.02 all settle to $20.00 in cash. Within that band the cash collected is IDENTICAL, so the highest price in it is strictly better — same from cash customers, up to 4 cents more from every card customer. That is genuinely free.
The move that looks clever and is not: pricing BELOW a nickel so rounding "adds" a couple of cents. You collect the same cash and less on card. The rounding delta is not revenue. Do not recommend it.
Input: listPrice as a dollar string, taxRatePercent, and optionally spreadCents (1-50, default 5) for how far either side to look.
Returns: the whole band, the highest price in it, the free gain in cents (never more than 4), and a verdict. Tell the user the size of the number. Four cents is not a pricing strategy.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rule | No | symmetric (default) is the Common Cents Act and Canadian method. always-down is Indiana's rule for cash payments of TAX, not a retail rule. always-up is not law anywhere for retail and is here only to quantify it. none is what a card gets. | |
| listPrice | Yes | A STRING is read as dollars ("19.99"); a NUMBER is read as integer CENTS (1999). A non-integer number is refused rather than guessed at. | |
| spreadCents | No | How far either side to look, 1-50. Default 5, which is one whole band. | |
| taxRatePercent | No | Percentage, e.g. 8.25 — not 0.0825. Supply it whenever it is known: rounding happens after tax, so the rate decides which nickel the total lands on. |