Number formatter

Format a number with thousands separators, in scientific or compact form, as an ordinal, or in words.

Input

The number to format.
Output style.
Separator style for decimal and compact output: en 1,234.5, de 1.234,5, fr 1 234,5, ch 1'234.5.
Digits after the decimal point. Leave empty to keep the number as written.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/number-format \
  -H 'Content-Type: application/json' \
  -d '{"input":{"value":"1234567.891","decimals":2}}'
import json, urllib.request

body = {'input': {'value': '1234567.891', 'decimals': 2}}
request = urllib.request.Request("https://setget.net/v1/tools/number-format", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/number-format", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"value":"1234567.891","decimals":2}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "number-format",
  "input": {
    "value": "1234567.891",
    "decimals": 2
  }
}
{
  "input": {
    "value": "1234567.891",
    "decimals": 2
  }
}

Endpoint: POST /v1/tools/number-format. Over MCP: run_tool with slug: "number-format". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
value string yes The number to format.
style string no Output style. One of: decimal, scientific, engineering, compact, ordinal, words. Default: "decimal".
locale string no Separator style for decimal and compact output: en 1,234.5, de 1.234,5, fr 1 234,5, ch 1'234.5. One of: en, de, fr, ch. Default: "en".
decimals integer no Digits after the decimal point. Leave empty to keep the number as written. From 0 to 20.

Examples

Input
{
  "value": "1234567.891",
  "decimals": 2
}
Result
{
  "text": "1,234,567.89",
  "style": "decimal",
  "locale": "en"
}

German separators

Input
{
  "value": "1234567.891",
  "locale": "de",
  "decimals": 1
}
Result
{
  "text": "1.234.567,9",
  "style": "decimal",
  "locale": "de"
}

Compact

Input
{
  "value": "1234567",
  "style": "compact"
}
Result
{
  "text": "1.2M",
  "style": "compact",
  "locale": "en"
}

Engineering notation

Input
{
  "value": "0.000047",
  "style": "engineering"
}
Result
{
  "text": "47e-6",
  "style": "engineering",
  "locale": "en"
}

In words

Input
{
  "value": "1234",
  "style": "words"
}
Result
{
  "text": "one thousand two hundred and thirty-four",
  "style": "words",
  "locale": "en"
}

Ordinal

Input
{
  "value": "22",
  "style": "ordinal"
}
Result
{
  "text": "22nd",
  "style": "ordinal",
  "locale": "en"
}

Questions

How are halves rounded?
Away from zero, the way most people learn at school: 2.5 becomes 3 and 0.125 with two decimals becomes 0.13.
What is engineering notation?
Scientific notation where the exponent is always a multiple of 3, so it lines up with prefixes such as kilo, mega and micro.
Which English is used for words?
British style with "and": one hundred and one. Whole numbers up to one quadrillion (10^15) are supported, and digits after a decimal point are read one by one.