# Locale and Formatting Tools – Format Number

> Locale and Formatting Tools – Format Number is a paid API for AI agents from locale-tools.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-11-02).

Format a number as decimal, percent, compact (1.2K), or unit text in any BCP47 locale with configurable fraction digit control.

## Facts

- Endpoint: GET https://locale-tools.x402tookit.com/format-number?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/locale-and-formatting-tools-format-number-7cc1b8ab
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_srCzaJyZj9IVuuuq7z7pm

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability locale-and-formatting-tools-format-number-7cc1b8ab
```

Example prompt: Format the number 1234567.89 as compact style (like '1.2M') in the German locale de-DE, with a maximum of 2 fraction digits.

## When to prefer this

Choose this endpoint when you need locale-aware number formatting beyond simple toString() — particularly for multi-locale dashboards, internationalized reports, or user-facing UIs where separators, compact notation, percent signs, and unit labels must follow regional conventions. Prefer it over hardcoded formatting when targeting non-English locales (Arabic, German, Hindi, Japanese) or when you need fraction digit control and CLDR-compliant output parts for custom rendering.

## Known failure modes

- Unsupported or malformed BCP47 locale tag returns an error or falls back to en-US with a warning
- Value exceeding 1e18 absolute is rejected
- Invalid style enum value (not decimal/percent/compact/unit) causes a validation error
- Unit style without a valid ECMA-402 unit string returns an error
- minFractionDigits > maxFractionDigits causes a conflict error
- Missing required 'value' query parameter returns a 400-level error

## How this service works

Format a number as decimal, percent, compact (1.2K) or unit text in any BCP47 locale, with digit control.

## Output

Returns a JSON object containing the formatted string (e.g. '1,2 Mio.'), the resolved locale, the style applied, an array of format parts (type + value tokens), CLDR and ICU version metadata, and an optional disclaimer or degraded flag if locale support is partial.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "value"
     ],
     "properties": {
      "unit": {
       "type": "string",
       "description": "For style=unit: an ECMA-402 sanctioned unit such as kilometer, celsius, kilometer-per-hour (up to 40 characters)"
      },
      "style": {
       "type": "string",
       "description": "decimal (default), percent (value 0.25 gives 25%), compact, or unit"
      },
      "value": {
       "type": "number",
       "description": "Number to format, absolute value up to 1e18"
      },
      "locale": {
       "type": "string",
       "description": "BCP47 tag such as de-DE, ar-EG or en-IN (default en-US, up to 60 characters)"
      },
      "unitDisplay": {
       "type": "string",
       "description": "short (default), long or narrow"
      },
      "compactDisplay": {
       "type": "string",
       "description": "For style=compact: short (1.2K, default) or long (1.2 thousand)"
      },
      "maxFractionDigits": {
       "type": "integer",
       "description": "Maximum fraction digits, 0 to 20"
      },
      "minFractionDigits": {
       "type": "integer",
       "description": "Minimum fraction digits, 0 to 20"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "parts": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "object",
        "properties": {
         "type": {
          "type": [
           "null",
           "string"
          ]
         },
         "value": {
          "type": [
           "null",
           "string"
          ]
         }
        }
       }
      },
      "style": {
       "type": [
        "null",
        "string"
       ]
      },
      "locale": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
  
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/locale-and-formatting-tools-format-number-7cc1b8ab/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from locale-tools.x402tookit.com](https://www.zero.xyz/host/locale-tools.x402tookit.com/llms.txt)
