Commerce Platforms & DTC
Shopify

Why Floating-Point Wholesale Pricing Breaks Shopify Line Sheets (Integer-Cents Rounding & Case-Pack Math)

Build a Shopify line-sheet pricing pipeline in TypeScript with exact cents, keystone MSRP, case-pack MOQ rounding, and boutique and distributor margin checks. Tagged with ecommerce, typescript, csv, webdev.
dev.to
November 28, 2026
7
Why Floating-Point Wholesale Pricing Breaks Shopify Line Sheets (Integer-Cents Rounding & Case-Pack Math)
WHAT HAPPENED
s gross margin uses landed cost and the wholesale price for the buyer ));}functionceilDiv(value:bigint,divisor:bigint):bigint{if(value=BPS){thrownewRangeError( With a landed cost of $0.14 and a 30% gross margin floor, $0.20 meets the floor exactly. The floating-point expression feeds20.000000000000004toMath.ceil, adding a cent to the minimum sell price. Once the CSV publishes that unit price, every unit in the order inherits the error.
Continue reading from the original publisher for the complete report and source context.
READ ORIGINAL STORY