Why 1.26 cubic metres of concrete comes out as 70 bags, or 71, depending on where you round

2026-11-29来源 dev.toEnglish

A 4 by 3 metre slab at 100 mm deep is 1.2 cubic metres. Add the usual 5 percent margin and you have 1.26. Divide by the yield on the bag and the order should be 70 bags. Written as code, that calculation returns 71, and the extra bag is not a rounding-up for safety. It is a rounding error, and it is one of four places where the same order can drift by a bag or by fifteen.

This is a small post about those four places. The code is real and runs in Node or in a browser console.

The numbers, before any code

The slab is fixed for the whole post:

length 4 m, width 3 m, depth 0.1 m volume = 1.2 m3 margin 5% -> 1.26 m3 bag yield 0.018 m3 (0.64 cubic feet, which is what a 36 kg bag states) 

The yield is the one number you have to read off the bag rather than compute. Different mixes state different figures, and the whole order moves when it moves.

Step one, the naive calculation

const slab = { length: 4, width: 3, depth: 0.1 }; const MARGIN = 0.05; const BAG_YIELD = 0.018; const volume = slab.length * slab.width * slab.depth; const withMargin = volume * (1 + MARGIN); const bags = Math.ceil(withMargin / BAG_YIELD); console.log(volume, withMargin, withMargin / BAG_YIELD, bags); // 1.2000000000000002 1.2600000000000002 70.00000000000001 71 

Seventy bags is the answer a person gets with a calculator. The code says 71 because 1.26 divided by 0.018 lands at 70.00000000000001, and Math.ceil does exactly what it is told with that number. The slab is not one hundredth of a bag short of 70. The arithmetic is.

Step two, rounding the ratio before you round the order

The fix is not to round the answer, but to decide how many digits matter before you take the ceiling:

const ratio = withMargin / BAG_YIELD; // 70.00000000000001 const bags = Math.ceil(Number(ratio.toFixed(6))); // 70 

Six decimal places is arbitrary but sufficient here, because no real bag yields a volume known to six places. The point is that a decision about precision has to be made explicitly, and the cheapest place to make it is before the ceiling, not after.

Step three, the order of operations moves the order

A margin can be applied before the division, after it, or to the rounded result. All three read like the same sentence in a specification, and they do not produce the same number:

const ceil = Math.ceil; const before = ceil(withMargin / BAG_YIELD); // 71 const perBag = ceil(volume / BAG_YIELD); // 67 const after = ceil(perBag * (1 + MARGIN)); // 71 const onTheRounded = perBag * (1 + MARGIN); // 70.35 console.log({ before, perBag, after, onTheRounded }); 

Applying the margin after the ceiling gives 70.35 bags, which is not a thing you can buy, so it becomes 71 again. Applying it before gives 71 for the reason in step one. A specification that says "add 5 percent" without saying where is ambiguous by one bag on this slab, and by more on a bigger one.

Step four, the margin you pick changes more than the rounding

The 5 percent was a choice. Ten percent is the other common figure, and it moves the order by three bags on the same slab:

for (const margin of [0.05, 0.10]) { const total = Math.ceil(Number((volume * (1 + margin) / BAG_YIELD).toFixed(6))); console.log(margin, total); // 0.05 70 / 0.1 74 } 

None of these numbers is wrong. What goes wrong is choosing the margin at one point in the process and the rounding at another, which is what most estimates do, because the margin is decided by the person measuring and the rounding is decided by the spreadsheet.

Why it matters at the scale of an order

On a slab this size, one bag is cheap. On a hundred square metres of driveway it stops being cheap, and the direction of the error matters more than the size: an order that rounds down leaves you short with the mixer already running, which costs a cold joint rather than a bag.

The fix that survives a change of slab, margin or bag is to keep the four decisions in one place: the volume, the margin, the yield, and the precision at which the ratio is rounded. If those four live in four different cells, nobody can tell you why the order is 71.

I keep a calculator that shows the intermediate figures rather than only the final one, so the ceiling step is visible: https://diyconcretecalc.com/

Owen Zhang, publisher of diyconcretecalc.com. Writes about quantity estimating for people pouring their own slabs, footings and paths.

原文:https://www.a8q9.cn/en/article/why-1-26-cubic-metres-of-concrete-comes-out-as-70-bags-or-71-depending-on-where--52ba43.html

相关文章