← All postsEngineering

Why case-to-each price conversion always leaves a few cents unaccounted for

iotoms team · October 27, 2026 · 5 min read

A snack and beverage distributor running eight vans out of a single depot sold most of its volume by the case — 36 bags to a case, one price on the vendor invoice, one price on the customer invoice. But a growing slice of its accounts were small corner stores and vending operators who didn't want a case of anything. They wanted six bags, or ten, or whatever fit the rack that week. So the system did what every inventory system does when a customer wants less than a full pack: it took the case cost, divided by the pack size, and sold the item by the each.

Nobody flagged this as a risk. It's the most ordinary feature a distribution system has.

The division that never comes out even

A case of 36 bags costing the distributor $48.00 looks simple until you actually run the division: $48.00 ÷ 36 = $1.3333..., a number that never terminates in cents. The system rounded it to $1.33 for display and for the invoice line, because customers don't get billed in thirds of a cent. Multiply that rounded each-price back out by 36, though, and you get $47.88 — twelve cents short of the $48.00 the case actually cost. Sell the case whole and the twelve cents never surfaces. Break it into eaches and sell all 36, and twelve cents of margin evaporates into the conversion, invisibly, every time.

Twelve cents on one case is nothing. The distributor was breaking cases on roughly 40 SKUs across eight vans, several hundred times a week, because broken-case sales to small-format accounts were exactly the growth segment the sales team was chasing. The controller doing the quarterly margin review found gross margin on that segment running consistently two to three points below the price list said it should, with no obvious cause — prices matched the list, costs matched the vendor invoices, nobody was discounting. The gap was the rounding, compounding across thousands of broken-case line items a month, and it had been there since the day the feature launched. It just took volume to make it visible, the same way the floating-point bug in a different distributor's invoicing only showed up once enough invoices were summed together.

Why rounding the display price isn't the bug

The instinct is to blame the rounding function — round to three decimals instead of two, or round half-up instead of down. That moves the gap around without closing it. The actual problem is upstream of rounding: the system was treating the rounded each-price as the authoritative cost, then re-deriving the case cost from it whenever accounting needed to reconcile. Round first, then multiply, and you've baked the rounding error into a number you're now treating as ground truth. The vendor invoice says the case costs $48.00. Nothing downstream should disagree with that.

The fix isn't a different rounding rule for the display price — the display price can keep rounding to the cent, because that's genuinely how customers get billed. The fix is keeping the case cost itself, and the conversion factor, as the source of truth, and carrying unrounded precision through every intermediate step:

  • Store the case cost and the conversion factor (36 eaches per case) as the base facts, never derive them backward from a rounded each-price.
  • Carry the each-cost at higher precision internally — four or five decimal places, not two — so $1.33333 doesn't collapse to $1.33 until the moment it has to appear on a screen or a printed line.
  • Round only once, at the point of display or posting, never at an intermediate calculation step that something else will later multiply or sum.
  • When a case gets broken and sold as 36 separate eaches, the 36 rounded line totals won't sum back to exactly $48.00 — assign that known, bounded remainder to a cost-variance line instead of letting it silently disappear into margin. A few cents in a variance account is auditable; the same few cents missing from margin is a mystery.
  • Reconcile actual cost of goods sold against the original case cost, not against the sum of rounded each-prices, so the quarterly margin review doesn't have to go looking for a bug that's actually just arithmetic.

What this actually costs if you skip it

None of this shows up in a demo. A single broken case, checked by hand, looks fine — twelve cents doesn't register. It only becomes a line item worth chasing once a sales team has done its job and pushed volume into exactly the selling pattern — small accounts, broken cases, high frequency — that most distributors are actively trying to grow. The irony is that the SKUs most likely to carry this bug are the ones a distributor is counting on for expansion, so the margin leak grows in proportion to the part of the business that's working.

Practical checklist

  • Treat the case cost and the conversion factor as the only source of truth; never recompute them backward from a rounded unit price.
  • Carry unit costs at higher internal precision (4+ decimal places) and round only at the final display or posting step.
  • Define one explicit remainder rule for broken-case sales and post it to a named variance account instead of absorbing it silently.
  • Reconcile margin against the original vendor case cost, not against a sum of already-rounded line prices.
  • Audit any SKU sold in more than one unit of measure at least once per quarter for exactly this gap, especially your fastest-growing small-format accounts.

iotoms stores every item's base cost and unit-of-measure conversions as the source of truth and carries full precision through every intermediate step, rounding only once at the invoice line — so breaking a case to serve a small-format account never quietly costs more than the price list says it should.

See your own routes running on iotoms

Book a demo