{
  "tag": "ed-format-number",
  "kind": "component",
  "summary": "Shows a number, amount or percentage in the user's locale from a raw value, so figures read and align the\nsame way everywhere.",
  "status": "experimental",
  "since": "1.0",
  "docs": "https://test-apps.eurodata.de/a/eurodata-ui/docs/components/format-number/",
  "usage": "https://test-apps.eurodata.de/a/eurodata-ui/docs/components/format-number/usage/",
  "playwright": "getByTestId('…')",
  "dependencies": [],
  "use": [
    "Every number users read — amounts, totals, quantities, rates, and percentages in text, tables, and summaries",
    "An invoice total or net pay in euro, with grouping and decimals the accountant expects, inside a summary or table cell",
    "A tax rate or share shown as a percentage in a report, passed as a fraction",
    "The same kind of amount in every row of a column, with the same number of decimals so digits line up"
  ],
  "notFor": [
    {
      "when": "Byte or file sizes",
      "instead": "[Format Bytes](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/format-bytes)"
    },
    {
      "when": "A number the user is supposed to edit",
      "instead": "[Input](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/input) (type number) or [Number Input](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/number-input)"
    }
  ],
  "rules": [
    {
      "id": "format-number/never-hand-format",
      "rule": "Never hand-format a number, and never concatenate currency symbols or separators by hand — pass the raw value and let the component follow the user's locale, symbol placement included.",
      "why": "\"1.234,56 €\" hardcodes German separators and symbol placement — the same amount must read \"€1,234.56\" for other locales. The symbol and its position differ per locale.",
      "check": "warning"
    },
    {
      "id": "format-number/explicit-currency",
      "rule": "Use the currency type with an explicit ISO 4217 code such as \"EUR\" for money — the default code is USD, so never rely on it.",
      "check": "error"
    },
    {
      "id": "format-number/percent-as-fraction",
      "rule": "Pass percentages as fractions — 0.19 renders as \"19 %\"; the scaling is part of the format. Never pass pre-multiplied percent values — 19 renders as \"1,900 %\".",
      "check": "warning"
    },
    {
      "id": "format-number/pin-fraction-digits",
      "rule": "Pin the minimum and maximum fraction digits where values in a column must align.",
      "check": "warning"
    },
    {
      "id": "format-number/same-precision-per-kind",
      "rule": "Keep the same precision for the same kind of value across the product.",
      "check": "warning"
    },
    {
      "id": "format-number/not-for-identifiers",
      "rule": "Never run identifiers, years, or codes through it — an invoice number is not a quantity.",
      "why": "Grouping turns 2026 into \"2.026\"."
    }
  ],
  "api": {
    "attributes": [
      {
        "name": "value",
        "property": "value",
        "type": "number",
        "default": "0",
        "description": "The number to format."
      },
      {
        "name": "type",
        "property": "type",
        "type": "'percent' | 'decimal' | 'currency'",
        "default": "'decimal'",
        "description": "The formatting style to use."
      },
      {
        "name": "without-grouping",
        "property": "withoutGrouping",
        "type": "boolean",
        "default": "false",
        "description": "Turns off grouping separators."
      },
      {
        "name": "currency",
        "property": "currency",
        "type": "string",
        "default": "'USD'",
        "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code to use when formatting."
      },
      {
        "name": "currency-display",
        "property": "currencyDisplay",
        "type": "'symbol' | 'code' | 'narrowSymbol' | 'name'",
        "default": "'symbol'",
        "description": "How to display the currency."
      },
      {
        "name": "minimum-integer-digits",
        "property": "minimumIntegerDigits",
        "type": "number",
        "description": "The minimum number of integer digits to use. Possible values are 1-21."
      },
      {
        "name": "minimum-fraction-digits",
        "property": "minimumFractionDigits",
        "type": "number",
        "description": "The minimum number of fraction digits to use. Possible values are 0-100."
      },
      {
        "name": "maximum-fraction-digits",
        "property": "maximumFractionDigits",
        "type": "number",
        "description": "The maximum number of fraction digits to use. Possible values are 0-100."
      },
      {
        "name": "minimum-significant-digits",
        "property": "minimumSignificantDigits",
        "type": "number",
        "description": "The minimum number of significant digits to use. Possible values are 1-21."
      },
      {
        "name": "maximum-significant-digits",
        "property": "maximumSignificantDigits",
        "type": "number",
        "description": "The maximum number of significant digits to use. Possible values are 1-21."
      },
      {
        "name": "dir",
        "property": "dir",
        "type": "string"
      },
      {
        "name": "lang",
        "property": "lang",
        "type": "string"
      }
    ],
    "properties": [],
    "methods": [],
    "events": [],
    "slots": [],
    "cssProperties": [],
    "parts": [],
    "states": []
  },
  "import": "import '@eurodata/eurodata-ui/dist/components/format-number/format-number.js';",
  "react": {
    "component": "EdFormatNumber",
    "import": "import EdFormatNumber from '@eurodata/eurodata-ui/dist/react/format-number/index.js';"
  }
}
