Formatting Utilities

Format Currency

Formats numeric amounts into localized currency strings with proper symbols, decimal places, and thousand separators. Use via MCP in Cursor or Windsurf, or call GET /v1/format/currency with amount and currency code. Returns "$1,234.56" for USD, "€1.234,56" for EUR, "¥1,235" for JPY. Handles 150+ currencies with correct regional formatting rules automatically.

API Endpoint

GET /v1/format/currency

Code Examples

curl "https://tinyfn.io/v1/format/currency" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/format/currency', {
  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/currency',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

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"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How do I format currency in different locales using MCP?

Pass the amount, currency code (like 'USD', 'EUR'), and optional locale. The tool applies regional formatting rules automatically — USD uses periods for decimals, EUR often uses commas.

What currency codes does the format currency tool support?

Supports all ISO 4217 currency codes including USD, EUR, GBP, JPY, CAD, AUD, CHF, CNY, and 140+ others. Each currency uses its standard symbol and decimal precision.

Does currency formatting handle decimal places correctly for different currencies?

Yes, it automatically applies currency-specific decimal rules. USD shows 2 decimals ($10.50), JPY shows none (¥1,050), and BHD shows 3 (BD 10.500).

Can I format negative currency amounts?

Yes, negative amounts format according to regional conventions. Some locales use parentheses ($1,000), others use minus signs -$1,000 or place symbols differently.

How does currency formatting work with very large numbers?

Handles amounts up to JavaScript's safe integer limit with proper thousand separators. For example, 1000000 becomes $1,000,000.00 in USD formatting.

Try Format Currency Now

Get your free API key and start using Format Currency in seconds.

Get Free API Key