{
  "schemaVersion": 1,
  "slug": "currency-converter-calculator",
  "category": "finance",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "423e2347519d84b777aadf59c96a0594907c33d191e3583d6db40f798e2d61f4",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/currency-converter-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": "Y = A × R",
    "vars": [
      [
        "A",
        "Amount"
      ],
      [
        "R",
        "Exchange rate"
      ]
    ],
    "note": "Inverse rate = 1 ÷ R (0 if R = 0)."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const a=Number(amount),r=Number(rate);if(!Number.isFinite(a)||!Number.isFinite(r)||a<0||r<=0)return{converted:null,inverse:null,__error:'inputError'};return{converted:a*r,inverse:1/r};",
    "inputs": [
      {
        "name": "amount",
        "type": "number",
        "default": 100,
        "min": 0,
        "max": 1000000000,
        "step": 1
      },
      {
        "name": "rate",
        "type": "number",
        "default": 0.92,
        "min": 0,
        "max": 100000,
        "step": 0.0001
      }
    ],
    "outputs": [
      {
        "name": "converted",
        "precision": 2,
        "unit": ""
      },
      {
        "name": "inverse",
        "precision": 6,
        "unit": ""
      }
    ],
    "interpret": null
  }
}
