{
  "schemaVersion": 1,
  "slug": "electric-current-calculator",
  "category": "conversion",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "e4e71339067dc9559254801525d5604767e19aa2d5b03bd4a822d2c7f37c51f8",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/electric-current-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": "I_out = I_in × f_in ÷ f_out",
    "vars": [
      [
        "I_in",
        "Input current"
      ],
      [
        "f_in",
        "Source factor in amperes (A 1, mA 10⁻³, µA 10⁻⁶, kA 10³)"
      ],
      [
        "f_out",
        "Target factor"
      ],
      [
        "I_out",
        "Converted current"
      ]
    ],
    "note": "All factors are relative to the ampere (microampere µA); pure unit conversion."
  },
  "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": "Convert electric current via amperes and SI prefixes.",
    "limitations": "Only the displayed unit definitions are converted; rounding and measurement uncertainty are separate.",
    "implementationHash": "e4e71339067dc9559254801525d5604767e19aa2d5b03bd4a822d2c7f37c51f8",
    "domain": "conversion"
  },
  "contract": {
    "compute": "const units={\"a\":\"A\",\"ma\":\"mA\",\"ua\":\"µA\",\"ka\":\"kA\"}, factors={\"a\":1,\"ma\":0.001,\"ua\":0.000001,\"ka\":1000}; if(!Number.isFinite(value)||value<-1000000000000||value>1000000000000||!Object.prototype.hasOwnProperty.call(units,from)||!Object.prototype.hasOwnProperty.call(units,to))return {\"result\":null,\"amperes\":null,\"milliamps\":null,\"chargePerSecond\":null,\"__error\":\"inputError\"}; const out=(function(){const F={a:1,ma:0.001,ua:1e-6,ka:1000}; const a=value*F[from]; return { result: a/F[to], amperes: a, milliamps: a*1000, chargePerSecond: a };})(); if(out.__error)return {...{\"result\":null,\"amperes\":null,\"milliamps\":null,\"chargePerSecond\":null},...out}; out.__resultUnit=units[to]; out.__unitRatio=factors[to]/factors[from]; return out;",
    "inputs": [
      {
        "name": "value",
        "type": "number",
        "default": 1,
        "min": -1000000000000,
        "max": 1000000000000,
        "step": 0.0001,
        "requiredValue": true,
        "strictRange": true
      },
      {
        "name": "from",
        "type": "select",
        "default": "ma",
        "options": [
          {
            "value": "ma"
          },
          {
            "value": "a"
          },
          {
            "value": "ua"
          },
          {
            "value": "ka"
          }
        ]
      },
      {
        "name": "to",
        "type": "select",
        "default": "a",
        "options": [
          {
            "value": "a"
          },
          {
            "value": "ma"
          },
          {
            "value": "ua"
          },
          {
            "value": "ka"
          }
        ]
      },
      {
        "name": "precision",
        "type": "select",
        "default": 4,
        "options": [
          {
            "value": 0
          },
          {
            "value": 2
          },
          {
            "value": 4
          },
          {
            "value": 6
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "result",
        "precision": 4,
        "unit": "",
        "precisionField": "precision",
        "unitField": "__resultUnit",
        "trimTrailingZeros": true,
        "notation": "auto"
      },
      {
        "name": "amperes",
        "precision": 6,
        "unit": "A",
        "showWhen": {
          "to": [
            "ma",
            "ua",
            "ka"
          ]
        },
        "notation": "auto"
      },
      {
        "name": "milliamps",
        "precision": 3,
        "unit": "mA",
        "showWhen": {
          "to": [
            "a",
            "ua",
            "ka"
          ]
        },
        "notation": "auto"
      },
      {
        "name": "chargePerSecond",
        "precision": 6,
        "unit": "C/s",
        "notation": "auto"
      }
    ],
    "interpret": null
  }
}
