Shipping carriers bill the higher of actual and dimensional weight, and rounding order changes the total
A developer walkthrough explains how carriers bill parcels at the greater of actual weight and dimensional weight, which is volume divided by a contract divisor. It recommends doing the calculation in integer millimetres, grams and BigInt to avoid floating-point errors. The article stresses that rounding must follow the contract's order: sides first, then dimensional weight, then the billable weight to the contract step. It also notes that carriers round up rather than to nearest, so checkers should use ceiling rounding. Finally, it proposes a property test confirming that enlarging any side can never reduce the billed weight, and it closes by promoting a paid audit tool.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in