Worked example · updated 2026-10-13

Worked pack-price example: why 36 items cost 59.97, not the rounded display total

An invented $19.99 pack of 12 distinguishes the purchase basis from a rounded per-item comparison and shows exactly where a misleading total arises.

An example. Scope and evidence limitations are described below.

4 sections · 1 code sample · 1 priced service · 3 sources

Done for you: Fix one reproducible bug with a failing-then-passing regression test, From $385.

Explicit invented inputs

Currency is USD; price is 19.99 per pack; each pack contains 12 items; the order quantity is three whole packs. The example rounds a displayed per-item price half-up to cents. Tax, freight, discounts, variable pack sizes and foreign exchange are excluded. This is arithmetic, not an invoice, purchase recommendation or accounting rule.

If the matrix is wider than the box, scroll horizontally to read every column. Keyboard: focus the matrix and use Left/Right.

items ordered = 12 items/pack × 3 packs = 36 items
pack-based amount = $19.99/pack × 3 packs = $59.97
unrounded item price = $19.99 ÷ 12 = $1.665833…
displayed item price, half-up = $1.67
wrong display-based total = $1.67 × 36 = $60.12
difference = $0.15

The expected assertions

Assert 36 items and 5,997 cents as separate results. Assert that the 167-cent display value is not used to derive the amount. The local synthetic model uses exact integer-cent arithmetic for these nonnegative inputs; it is not a general decimal library or an implemented supplier importer.

  • Unknown, zero, negative or fractional pack sizes are held under this example's whole-pack policy.
  • Confirm whether the real supplier quotes per item, per pack or by weight before comparing.
  • A real rounding policy must be chosen by the authorised business owner, not copied from this example.

What this evidence cannot establish

No supplier order, application preview or payment was executed. These checks cannot establish taxes, freight, legal invoice amounts or product equivalence. The correct arithmetic still produces a misleading comparison if the source's units or currency were mapped incorrectly.

  • Keep quantity conversion and monetary basis visible in the approval request.
  • Real documents and customer records are unnecessary for the initial reproduction.

Priced message and non-fit

One existing-code calculation defect with an owner-approved unit and rounding rule may fit fix-one-bug-with-regression-test, from $385 after bounded synthetic reproduction and a fixed repair quote. Accounting policy, schema changes, landed-cost modelling and correction of real orders are not included. Send invented inputs, the stated basis and the expected results initially, not code or private financial documents. Payment follows agreed passing checks and sign-off.

Sources and limits