Converts integers to ordinal strings like "1st", "2nd", "3rd", "21st". Use via MCP in Cursor or Windsurf for natural language processing, or call GET /v1/format/ordinal?number=42 to get "42nd". Handles English ordinal suffixes correctly, including edge cases like 11th-13th that break typical -st/-nd/-rd patterns.
curl "https://tinyfn.io/v1/format/ordinal" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/format/ordinal', {
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/ordinal',
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"
}
}
}
}
Call the format_ordinal tool with your number. It returns the properly suffixed string like '1st', '2nd', '3rd', handling all English ordinal rules including the 11th-13th exceptions.
GET /v1/format/ordinal?number=VALUE where VALUE is your integer. Returns JSON with the formatted ordinal string.
Yes, it works with negative integers, returning forms like '-1st', '-2nd'. The ordinal suffix rules apply the same way regardless of sign.
English ordinals have special cases for numbers ending in 11, 12, 13 — they always use -th suffix, not the typical -st/-nd/-rd pattern.
Absolutely. Claude, GPT, and other models use this MCP tool to correctly format rankings, dates, and sequences without hallucinating incorrect ordinal forms.
Get your free API key and start using Format Ordinal in seconds.
Get Free API Key