{"uid":"cap_yLkrfH_YDYG5XOwm1MkLT","slug":"locale-and-formatting-tools-format-currency-e5c7bf68","name":"Locale and Formatting Tools – Format Currency","description":"Format an amount as money for an ISO 4217 currency code in a locale; reports minor-unit digits; unknown codes rejected.","url":"https://locale-tools.x402tookit.com/format-currency?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["amount","currency"],"properties":{"amount":{"type":"number","description":"Amount in major units, absolute value up to 1e15"},"locale":{"type":"string","description":"BCP47 tag such as en-US, de-DE, ja-JP (default en-US, up to 60 characters)"},"display":{"type":"string","description":"symbol (default), narrowSymbol, code or name"},"currency":{"type":"string","description":"Three-letter ISO 4217 code such as USD, JPY or KWD; must be known to ICU"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"parts":{"type":["array","null"],"items":{"type":"object","properties":{"type":{"type":["null","string"]},"value":{"type":["null","string"]}}}},"locale":{"type":["null","string"]},"source":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"currency":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"formatted":{"type":["null","string"]},"disclaimer":{"type":["null","string"]},"icuVersion":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"cldrVersion":{"type":["null","string"]},"currencyName":{"type":["null","string"]},"resolvedLocale":{"type":["null","string"]},"unicodeVersion":{"type":["null","string"]},"minorUnitDigits":{"type":["null","number"]},"minorUnitsAmount":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ptDd7JovElE4-2w2QKdNP","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Formats a numeric amount as a localized currency string for a given ISO 4217 currency code and BCP47 locale, returning the formatted value, minor-unit digit count, and decomposed parts.","exampleAgentPrompt":"Format 1250.75 as Japanese yen (JPY) using the ja-JP locale and show me the symbol display — I also want to know how many minor-unit digits JPY uses.","exampleUseCases":[{"title":"Localized price display for e-commerce","prompt":"I need to show a product price of 49.99 EUR to a German customer — can you format it as euros using the de-DE locale with the standard currency symbol?"},{"title":"Invoice amount in Kuwaiti dinar","prompt":"Format 3500 KWD for a Kuwaiti invoice — use the ar-KW locale and display the full currency name instead of the symbol, and tell me how many decimal places KWD uses."},{"title":"Multi-currency checkout summary","prompt":"I'm building a checkout page — format 120.00 GBP in en-GB locale using the narrow symbol style so I know exactly how it'll look to UK users."}],"resultDescription":"Returns a JSON object with the formatted currency string (e.g. '$1,234.56'), the resolved locale, the currency name, the number of minor-unit digits for that currency, the equivalent amount in minor units, an array of decomposed parts (integer, decimal, fraction, symbol, etc.), ICU/CLDR/Unicode version info, and a degraded flag if formatting fell back to a less-specific locale.","failureModes":["Unknown or unsupported ISO 4217 currency code returns an error — only codes recognized by ICU are accepted","Malformed BCP47 locale tag may be rejected or silently resolved to a fallback locale","Amount exceeding 1e15 in absolute value is rejected","Missing required 'amount' or 'currency' query parameters returns a 4xx error","Invalid 'display' enum value outside symbol/narrowSymbol/code/name may be rejected"],"whenToPreferThis":"Choose this endpoint when you need locale-aware, ICU-backed currency formatting rather than simple symbol prepending — especially when you need correct minor-unit digit counts (e.g. JPY has 0, KWD has 3), decomposed formatting parts for custom rendering, or support for dozens of locales and display styles. Prefer this over general number formatting endpoints when currency-specific rules (grouping, decimal, symbol placement) are required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-02T12:31:13.558Z","isFirstParty":false,"canonicalSlug":"locale-and-formatting-tools-format-currency-e5c7bf68"}