Area read-out
64-bitPrints an area in the project's area unit.
text = round to 0 decimals, grouped
The area is rounded to a whole unit only in the text; the stored mass is not changed.
const area = (v) => grouped(v, 0) + ' ' + unitOf(U()).area;
Resources Numerical accuracy Calculation policy
The footprint and floor-area read-outs of a building mass, the zoning coverage field, and what happens to a typed height.
Areas and volumes come from massing.js as 64-bit numbers and are formatted here. A typed building height is not stored: it is divided by the floor height and rounded to a whole number of floors.
3 calculations in 1 source file. The code is read from the released app when this page loads. It is the calculation people run, not a copy kept for this page.
Tests None found by the review
Prints an area in the project's area unit.
text = round to 0 decimals, grouped
The area is rounded to a whole unit only in the text; the stored mass is not changed.
const area = (v) => grouped(v, 0) + ' ' + unitOf(U()).area;
Turns a height the person types into a whole number of floors.
floors = clamp(round(H ÷ floor height), 1, max floors)
The division is 64-bit and Math.round snaps it to a whole floor, so the typed height itself is not kept. The same rounding is in massing.js setHeight.
const hgt = ctx.numInput(fixed(massHeight(m), 2).replace(/,/g, ''), (v) => { const n = Number(v); if (!(n > 0)) return false; edit(m.id, t('ms.undo.height'), (q) => { q.floors = setHeight(q, n); }); return true; }, { label: t('ms.height', { u: L() }), id: 'cv-ms-height', width: '6rem' });
Turns the percent a person types for building coverage into the stored fraction.
coverage = n ÷ 100
The typed text is converted with Number and divided by 100 in 64-bit arithmetic. The field shows the stored value back as coverage × 100 with 1 decimal.
...ctx.row(t('zn.coverage'), ctx.numInput(z.coverage ? fixed(z.coverage * 100, 1).replace(/,/g, '') : '', (v) => { const s = String(v).trim(), n = s === '' ? 0 : Number(s); if (!(n >= 0 && n <= 100)) return false; editZone(parcelId, t('zn.undo.set'), (q) => { q.coverage = n / 100; }); return true; }, { label: t('zn.coverage'), id: 'cv-zn-cov', width: '6rem', calc: false }), 'cv-zn-cov'),
The arithmetic is 64-bit, but the method or the data sets the accuracy: a solver tolerance, a mesh, a step size, a datum shift, a table. The limit is stated where the result is shown.