How the Currency Formatter Works
AnyTool Currency Formatter is a thin, safe wrapper over the browser-native Intl.NumberFormat. It parses the typed amount into a number (tolerating thousands separators), builds an options object with style set to currency plus the chosen currency code, and constructs a formatter for the selected locale inside a try/catch so an unsupported currency–locale pair degrades gracefully rather than throwing. The currency (an ISO 4217 code) determines the symbol and the default number of fraction digits, while the locale (a BCP-47 tag) determines digit grouping and where the symbol is placed — which is why the same amount renders as $1,234.56, 1.234,56 € or ₹1,234.56 depending on the locale, not the currency.
- Built entirely on the standard Intl.NumberFormat API
- Currency code sets the symbol and default fraction digits (ISO 4217)
- Locale (BCP-47) sets grouping and symbol placement
- Unsupported combinations are caught and reported, never thrown
- All formatting is client-side JavaScript — no server round-trip
