number-formatter
A number formatter turns a raw number into a styled string β currency ($1,234.56), percent (12.5%), scientific notation (1.50e+06), engineering notation (1.50M), or custom (format-string driven). Useful when downstream systems need a specific shape, when localising for international audiences, or when generating reports with consistent formatting. The ZTools Number Formatter wraps the browser's Intl.NumberFormat API plus a custom format-string engine, supports 100+ locales, and runs entirely client-side.
Use casesβ
Generate localised currency stringsβ
Same value, different locales: $1,234.56 (US), Β£1,234.56 (UK), 1.234,56 β¬ (DE), Β₯1,235 (JP). One source, many outputs.
Format dashboard numbers compactlyβ
"$1,234,567" doesn't fit; "$1.23M" does. Compact notation gives readable summary tiles.
Format percentagesβ
0.125 β 12.5%. Standard for displaying ratios and conversion rates.
Scientific notation for engineeringβ
0.000000123 β 1.23 Γ 10β»β·. Easier to read at a glance for orders-of-magnitude work.
How it worksβ
- Paste number β Single value or list. Tool detects format.
- Pick style β Decimal (1,234.56), currency, percent, scientific, engineering, or compact (1.23M).
- Configure β Locale, currency code (USD, GBP, EUR, ...), decimal places, sign style.
- Read output β Formatted string β ready to paste into a report, UI mockup, or code.
Examplesβ
Input: 1234.56, currency USD
Output: $1,234.56 (en-US). $1,234.56 USD (en-CA). USD 1,234.56 (de-DE forced USD).
Input: 0.125, percent
Output: 12.5%.
Input: 1500000, compact
Output: 1.5M (en) / 1,5 Mio. (de) / 150δΈ (ja). Locale-aware abbreviations.
Input: 0.0000123, scientific
Output: 1.23E-5 / 1.23 Γ 10β»β΅.
Frequently asked questionsβ
What's the difference between compact and scientific?
Compact uses locale abbreviations (M, K, B). Scientific uses powers of 10. Compact is for casual reading; scientific for precision and engineering.
How do I choose decimals?
Default is 2 (currency) or "as-needed" (decimal). Lock to specific count for consistency in tables. Don't round below the precision you need to communicate.
Locale support?
All Intl.NumberFormat-supported locales (~100+). Major ones cover ~99% of use cases.
Custom format strings?
Toggle "custom" to use printf-style format: "%.2f%%" β "12.50%". Familiar to Excel / SQL / Python users.
Privacy?
All client-side.
Tipsβ
- For dashboards, prefer compact notation β saves space without losing meaning at a glance.
- For finance / accounting, lock decimal places. "$1,234.5" and "$1,234.50" should never appear in the same report.
- For percentages, use the percent style not "x Γ 100 + %" β locale-aware percent style handles RTL languages and unusual locales correctly.
- When integrating with code, use Intl.NumberFormat directly β this tool is for one-off / prototyping use.
Try it nowβ
The full number-formatter runs in your browser at https://ztools.zaions.com/number-formatter β no signup, no upload, no data leaves your device.
Last updated: 2026-05-06 Β· Author: Ahsan Mahmood Β· Edit this page on GitHub