Menu

How we built 35 construction calculators with plain JavaScript and one shared formulas file
πŸ“°

How we built 35 construction calculators with plain JavaScript and one shared formulas file

DEV Community: beginnersΒ·zeeshan hussainΒ·about 2 hours ago
#O8pVpSp2
#devtobeginners#devto#dev#form#every
Reading 0:00
15s threshold

Construction math looks simple until you have to get it right for a stranger. "How many 80 lb bags of concrete for this slab?" mixes feet, inches, cubic yards, a waste allowance, and a bag yield that is a property of the product rather than the geometry. Get one unit wrong and someone buys twice the concrete they need.

We run Free Construction Calculators , a set of 35 free calculators for concrete, gravel, mulch, roofing, paint, drywall, stairs and more. This post is about the structure that kept those 35 pages consistent: no framework, no build step in the browser, and one file of pure functions that every calculator shares.

The rule: all internal math in feet and cubic feet

Every input gets converted to feet (or inches for small depths) at the edge, and every function inside works in one unit system. Metric users still type metres and centimetres.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.