{
  "schemaVersion": 1,
  "slug": "grout-calculator",
  "category": "household",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "1f57bb3fe4fcca1b88ebcebaa5fa1156aac89d7e1aef51d77d223738f57e83e6",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/grout-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "G = A×144/(L×W)×(L+W)×2.54³×J×D×1.6/1000",
    "vars": [
      [
        "A",
        "Tiled area, ft²"
      ],
      [
        "L",
        "Tile length, in"
      ],
      [
        "W",
        "Tile width, in"
      ],
      [
        "J",
        "Joint width, in"
      ],
      [
        "D",
        "Tile thickness, in"
      ],
      [
        "G",
        "Grout required, kg"
      ]
    ],
    "note": "bags = ceil(G/5) for 5 kg bags; pounds = G×2.20462."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const mergedResult=(()=>{\nif((true&&(!Number.isFinite(area)||area<0||area>10000))||(true&&(!Number.isFinite(tileLength)||tileLength<0.5||tileLength>60))||(true&&(!Number.isFinite(tileWidth)||tileWidth<0.5||tileWidth>60))||(true&&(!Number.isFinite(tileDepth)||tileDepth<0.1||tileDepth>3))||(true&&(!Number.isFinite(jointWidth)||jointWidth<0.0625||jointWidth>1)))return{__error:'inputError'};\nconst tilesPerSqft = 144/(tileLength*tileWidth); const jointLengthIn = area*tilesPerSqft*(tileLength+tileWidth); const groutKg = jointLengthIn*2.54*jointWidth*2.54*tileDepth*2.54*1.6/1000; return { groutVolume:jointLengthIn*jointWidth*tileDepth,jointLength: jointLengthIn/12, groutKg, groutLb: groutKg*2.20462, bags: Math.ceil(groutKg/5) };\n})();return mergedResult.__error?{\"jointLength\":null,\"groutKg\":null,\"groutLb\":null,\"bags\":null,\"groutVolume\":null,...mergedResult}:mergedResult;",
    "inputs": [
      {
        "name": "area",
        "type": "number",
        "default": 100,
        "min": 0,
        "max": 10000,
        "step": 1,
        "requiredValue": true,
        "strictRange": true
      },
      {
        "name": "tileLength",
        "type": "number",
        "default": 12,
        "min": 0.5,
        "max": 60,
        "step": 0.5,
        "slider": true,
        "requiredValue": true,
        "strictRange": true
      },
      {
        "name": "tileWidth",
        "type": "number",
        "default": 12,
        "min": 0.5,
        "max": 60,
        "step": 0.5,
        "slider": true,
        "requiredValue": true,
        "strictRange": true
      },
      {
        "name": "tileDepth",
        "type": "number",
        "default": 0.375,
        "min": 0.1,
        "max": 3,
        "step": 0.025,
        "slider": true,
        "requiredValue": true,
        "strictRange": true
      },
      {
        "name": "jointWidth",
        "type": "number",
        "default": 0.125,
        "min": 0.0625,
        "max": 1,
        "step": 0.0625,
        "slider": true,
        "requiredValue": true,
        "strictRange": true
      }
    ],
    "outputs": [
      {
        "name": "jointLength",
        "precision": 0,
        "unit": "ft"
      },
      {
        "name": "groutKg",
        "precision": 2,
        "unit": "kg"
      },
      {
        "name": "groutLb",
        "precision": 2,
        "unit": "lb"
      },
      {
        "name": "bags",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "groutVolume",
        "precision": 2,
        "unit": "in³"
      }
    ],
    "interpret": null
  }
}
