{
  "schemaVersion": 1,
  "slug": "meters-feet-calculator",
  "category": "conversion",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "b8560ee718a45bc2c809ec354b958d5e908dde9f6f2c26b9713fbebcd062fff0",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/meters-feet-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": "ft = m ÷ 0.3048; m = ft × 0.3048",
    "vars": [
      [
        "ft",
        "length in feet"
      ],
      [
        "m",
        "length in metres"
      ]
    ],
    "note": "1 ft = 0.3048 m = 12 in. The feet-inches output splits total inches; cm = m × 100."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-04",
    "sources": [
      {
        "name": "NIST SP 811 — Conversion factors by quantity",
        "url": "https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors/nist-guide-si-appendix-b9"
      }
    ],
    "basis": "1 international foot = 0.3048 m.",
    "limitations": "Only the displayed unit definitions are converted; rounding and measurement uncertainty are separate.",
    "implementationHash": "b8560ee718a45bc2c809ec354b958d5e908dde9f6f2c26b9713fbebcd062fff0",
    "domain": "conversion"
  },
  "contract": {
    "compute": "const F={\"m\":1,\"ft\":0.3048}, U={\"m\":\"m\",\"ft\":\"ft\"}, L={\"m2ft\":[\"m\",\"ft\"],\"ft2m\":[\"ft\",\"m\"]}; const pair=Object.prototype.hasOwnProperty.call(L,direction)?L[direction]:[from,to], source=pair[0], target=pair[1]; if(!Number.isFinite(value)||value<-1000000000||value>1000000000||!Object.prototype.hasOwnProperty.call(F,source)||!Object.prototype.hasOwnProperty.call(F,target))return {\"result\":null,\"feetInches\":null,\"cm\":null,\"__error\":\"inputError\"}; const base=value*F[source], out=(function(value,direction){const metres = direction === 'm2ft' ? value : value*0.3048; const totalInches = metres/0.0254; const roundedTenths = Math.round(Math.abs(totalInches)*10); const ft = Math.floor(roundedTenths/120); const rem = (roundedTenths-ft*120)/10; const sign = totalInches < 0 ? '-' : ''; return { result: direction === 'm2ft' ? metres/0.3048 : metres, feetInches: sign + ft + ' ft ' + rem.toFixed(1) + ' in', cm: metres*100 };})(base/F[\"m\"],\"m2ft\"); if(out.__error)return {...{\"result\":null,\"feetInches\":null,\"cm\":null},...out}; out.result=value*(F[source]/F[target]);out.__resultUnit=U[target];out.__unitRatio=F[target]/F[source];return out;",
    "inputs": [
      {
        "name": "value",
        "type": "number",
        "default": 1.8,
        "min": -1000000000,
        "max": 1000000000,
        "step": 0.01,
        "requiredValue": true,
        "strictRange": true
      },
      {
        "name": "direction",
        "type": "select",
        "default": "auto",
        "options": [
          {
            "value": "auto"
          },
          {
            "value": "m2ft"
          },
          {
            "value": "ft2m"
          }
        ],
        "showWhen": {
          "from": []
        }
      },
      {
        "name": "precision",
        "type": "select",
        "default": 4,
        "options": [
          {
            "value": 0
          },
          {
            "value": 2
          },
          {
            "value": 4
          },
          {
            "value": 6
          }
        ]
      },
      {
        "name": "from",
        "type": "select",
        "default": "m",
        "options": [
          {
            "value": "m"
          },
          {
            "value": "ft"
          }
        ]
      },
      {
        "name": "to",
        "type": "select",
        "default": "ft",
        "options": [
          {
            "value": "ft"
          },
          {
            "value": "m"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "result",
        "precision": 4,
        "unit": "",
        "precisionField": "precision",
        "unitField": "__resultUnit",
        "trimTrailingZeros": true,
        "notation": "auto"
      },
      {
        "name": "feetInches",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "cm",
        "precision": 2,
        "unit": "cm",
        "notation": "auto"
      }
    ],
    "interpret": null
  }
}
