SellersMath
Invoicing

Rounding the unit price first costs 12 cents a line

24 units at $3.335 is $80.04 exactly. Round the unit to $3.34 and the same line is $80.16; round down to $3.33 and it is $79.92. Round once, at the line total.

A pale wooden desk: a squared stack of blank cards, a sharpened pencil, one wood shaving and a small brass weight.
Illustration: SellersMath — generated artwork for this piece, quoting a passage from its own argument.

The answer

24 units at $3.335 is $80.04 exactly. Round the unit price up to $3.34 before multiplying and the line is $80.16; round it down to $3.33 and the line is $79.92. Same product, same quantity, three totals 24 cents apart. Round once, at the line total, and either print the unit price to three decimals or leave it off.

The arithmetic

The exact line is 24 × $3.335 = $80.04, and it lands on the penny because the third decimal is cancelled by the quantity. Do the rounding a step earlier and the quantity multiplies the error: 24 × $3.34 = $80.16, which is 12 cents above the exact figure, and 24 × $3.33 = $79.92, which is 12 cents below it.

Add tax and each version carries its own number. At 20%: $80.04 becomes $96.05, $80.16 becomes $96.19, and $79.92 becomes $95.90. The customer is paying between $95.90 and $96.19 for the same goods depending on which step someone rounded at.

Across a year it is small and across a catalogue it is not.

The direction matters as much as the place. Round half up on every line and the customer always pays the extra half-cent; round half to even and they sometimes do and sometimes do not, which is correct and impossible to explain. On a four-line invoice, half-up on each line can drift by up to 2 cents against the exact total. On the total, it drifts by at most one.

Across a year it is small and across a catalogue it is not. 240 such lines a year is $28.80 of drift, which nobody will ever notice, but 24 units across five sizes and four prices is a spreadsheet that no longer adds up to the stock valuation, and that one gets found.

The three mistakes

The first is rounding the unit price and then multiplying by the quantity, which is the 12 cents. A unit price is a rate, and a rate keeps its precision until it becomes a line.

The second is rounding twice. Round the line, then round the invoice total, and the tax is now computed on a number that has already been rounded away from the sum of its parts. Round at the last step that is printed, once.

The third is printing a unit price the line does not reconcile to. If the invoice says 24 at $3.34 and the line reads $80.04, the customer multiplies and finds $80.16 and now distrusts every other line on the page.

What the document must carry

The quantity, the unit price at the precision you actually charge, and a line total that multiplying the first two gives you back. If it does not, the unit price does not belong on the document. Tax computed on the total actually charged, not on the exact figure behind it. And where a rounding adjustment exists at all, its own line with its own label, so it reads as a decision rather than an error.

The invoice generator keeps the unit price at whatever precision you type, multiplies at full precision and rounds the line, so the arithmetic on the page is the arithmetic that happened.

Where the lines matter more than the total, as they do on a bill a customer has to approve line by line, an itemised invoice shows the same rounding on every row, and a sheet that holds the stored precision is where the three-decimal unit price lives without being printed at all.

When this doesn’t apply

Where your prices are exact in your currency there is nothing to round and the whole question is the tax calculation. Some tax regimes require the tax to be computed per line and summed rather than computed on the total, which fixes where the rounding happens and takes the choice away from you. Marketplaces round per item before they ever reach your invoice, so the number you receive is already the rounded one. And in a currency whose smallest unit is five cents, the rounding table applies to the cash, once, on the amount handed over, and that adjustment belongs on the invoice as a line.