Format Number converts numeric values into locale-specific strings with proper thousand separators and decimal marks. Use via MCP in Cursor or Windsurf, or call GET /v1/format/number directly. Pass 1234567.89 with locale "en-US" to get "1,234,567.89" — essential for displaying financial data or user-facing numbers correctly across different regions.
curl "https://tinyfn.io/v1/format/number" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/format/number', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/format/number',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's formatting tools:
{
"mcpServers": {
"tinyfn-format": {
"url": "https://tinyfn.io/mcp/format",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Specify the locale parameter like 'de-DE' for German formatting (1.234.567,89) or 'fr-FR' for French (1 234 567,89). The tool handles decimal separators, thousand separators, and grouping automatically.
Supports all standard BCP 47 locale codes (en-US, ja-JP, ar-SA, etc.) and handles integers, floats, and scientific notation. Returns properly formatted strings with locale-appropriate separators.
Yes, use the minimumFractionDigits and maximumFractionDigits parameters to control precision. Set both to 2 for consistent currency formatting like '$1,234.00'.
Handles numbers up to JavaScript's MAX_SAFE_INTEGER limit and properly formats negative numbers, zero, and scientific notation according to locale rules.
This provides true locale-aware formatting with proper cultural conventions, unlike simple string manipulation. Critical for international applications where '1,234.56' vs '1.234,56' matters.
Get your free API key and start using Format Number in seconds.
Get Free API Key