Packs, steps and rounding: how the sums work
This page shows exactly how a customer’s amount becomes a price, with worked examples, so you can check the plugin’s arithmetic against your own. Reading time: five minutes.
The three rules
- Amounts round up to the next step, never down. If you sell 2.5 m² packs and a customer needs 12.3 m², they get 5 packs, which is 12.5 m². Nobody is ever sent less than they asked for.
- A step has one price, rounded to the penny. The step price is your price per unit times the step size, rounded half up. £24.99 per m² times 2.5 m² is £62.475, which becomes £62.48. That is the price shown for a pack and the price charged for every pack.
- The total is the step price times the number of steps. 5 packs at £62.48 is £312.40. The plugin never multiplies your unit price by the raw amount, so the total on the page, in the basket and on the order always agree to the penny.
Worked examples
Oak flooring, £24.99 per m², packs of 2.5 m², customer needs 12.3 m²
| Step | Result |
|---|---|
| Amount ÷ step | 12.3 ÷ 2.5 = 4.92 |
| Round up | 5 packs |
| Covers | 5 × 2.5 = 12.5 m² |
| Pack price | £24.99 × 2.5 = £62.475, rounded to £62.48 |
| Total | 5 × £62.48 = £312.40 |
The customer sees: “5 packs, 12.5 m², £312.40. 12.3 m² rounds up to the next pack. Each pack is £62.48.”
Linen fabric, £12.50 per metre, cut in 0.1 m steps, customer needs 3.55 m
| Step | Result |
|---|---|
| Amount ÷ step | 3.55 ÷ 0.1 = 35.5 |
| Round up | 36 steps |
| Length | 36 × 0.1 = 3.6 m |
| Step price | £12.50 × 0.1 = £1.25 |
| Total | 36 × £1.25 = £45.00 |
The customer sees: “36 × 0.1 m, 3.6 m, £45.00. 3.55 m rounds up to the next step.”
The product page for the fabric, with the rounding note outlined.
Cheddar, £18 per kg, sold by the whole kilogram, customer needs 3 kg
No rounding, no packs. The customer sees “3 kg, £54.00”.
Why the pack price is rounded, not the total
Two ways of charging give different pennies. Multiply £24.99 by 12.5 m² and you get £312.375, which a shop would round to £312.38. Charge 5 packs at £62.48 and you get £312.40. The plugin uses the second, always, because it is the honest one: the customer is buying packs at a pack price they can see, and a refund of one pack is exactly one pack price. The difference is never more than half a penny per pack.
When rounding the pack price changes the effective price per unit, the difference is tiny and the plugin shows the pack price so the customer can check it.
Whole numbers everywhere
Orders always contain a whole number of steps. WooCommerce sees a normal quantity and a normal price, which is why stock, refunds, reports, coupons, shipping rules and payment gateways all behave as they do for any other product. The measurement travels alongside as a note on the line.
Changing the quantity in the basket
The quantity in the basket is the number of steps. If a customer changes 5 to 6, they get six packs and the amount shown updates to 15 m². The price stays the pack price.
Decimal points and commas
Customers can type either a point or a comma as the decimal separator: 12.3 and 12,3 both work. The same is true in the product editor.