{
  "schemaVersion": 1,
  "slug": "cooking-measurement-converter",
  "category": "cooking",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "5290785bc77ad90dbf8e40505ef1a2a2a95acc6213246c0a972ab7db849a5e61",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/cooking-measurement-converter.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": "V_ml = V × k",
    "vars": [
      [
        "V",
        "value in the source unit"
      ],
      [
        "k",
        "source unit to ml factor"
      ],
      [
        "V_ml",
        "amount in millilitres"
      ]
    ],
    "note": "US customary constants: US cup 236.588 mL, tablespoon 14.7868 mL, teaspoon 4.9289 mL, US fluid ounce 29.5735 mL. Metric cup is 250 mL."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const ML = { cup:236.5882365, tbsp:14.7867648, tsp:4.92892159, ml:1, floz:29.5735295625, l:1000, pint:473.176473, quart:946.352946, gallon:3785.411784 }; const ml = value*(ML[from]||1); return { cups: ml/ML.cup, tablespoons: ml/ML.tbsp, teaspoons: ml/ML.tsp, ml, flOz: ml/ML.floz };",
    "inputs": [
      {
        "name": "value",
        "type": "number",
        "default": 1,
        "min": 0,
        "max": 100000,
        "step": 0.25
      },
      {
        "name": "from",
        "type": "select",
        "default": "cup",
        "options": [
          {
            "value": "cup"
          },
          {
            "value": "tbsp"
          },
          {
            "value": "tsp"
          },
          {
            "value": "ml"
          },
          {
            "value": "floz"
          },
          {
            "value": "l"
          },
          {
            "value": "pint"
          },
          {
            "value": "quart"
          },
          {
            "value": "gallon"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "cups",
        "precision": 4,
        "unit": "cups"
      },
      {
        "name": "tablespoons",
        "precision": 3,
        "unit": "tbsp"
      },
      {
        "name": "teaspoons",
        "precision": 2,
        "unit": "tsp"
      },
      {
        "name": "ml",
        "precision": 2,
        "unit": "ml"
      },
      {
        "name": "flOz",
        "precision": 3,
        "unit": "fl oz"
      }
    ],
    "interpret": null
  }
}
