Skip to content
POST AI agent ready /v1/number/format

Number Format API - Free Locale Formatting

Format a number using locale-specific rules for decimal separators, grouping, currency symbols, and percentage notation. Powered by the Intl.NumberFormat standard.

Parameters

numberrequired

The number to format.

string

BCP 47 locale tag.

string

Formatting style.

string

ISO 4217 currency code (required when style is "currency").

Code examples

curl -X POST https://api.botoi.com/v1/number/format \
  -H "Content-Type: application/json" \
  -d '{"number":1234567.89,"locale":"de-DE","style":"currency","currency":"EUR"}'

When to use this API

Internationalized pricing displays

Format product prices in the user locale so customers in Germany see 1.234,56 EUR while US customers see $1,234.56.

Report generation

Format financial figures in server-side PDF or email reports where client-side Intl APIs are not available.

Frequently asked questions

Which locales are supported?
All BCP 47 locale tags supported by the ICU library, including en-US, de-DE, ja-JP, ar-SA, and hundreds more.
Do I need to pass currency when using the currency style?
Yes. The currency parameter is required when style is "currency". The API returns an error if it is missing.
Can I format percentages?
Yes. Set style to "percent" and pass the number as a decimal (e.g., 0.85 for 85%).
Does this handle very large numbers?
Yes. The API supports numbers up to Number.MAX_SAFE_INTEGER (9,007,199,254,740,991). For larger values, pass them as strings.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.