Loading…
Loading…
Format a number for any locale — thousands separators, decimal commas, currency, percent, units and compact notation — and get the Intl.NumberFormat code.
Also covers: Thousands separator · Currency formatter · Intl.NumberFormat · Locale number format
Formatted
…
JavaScript
new Intl.NumberFormat("en-US", {"style":"decimal","maximumFractionDigits":2}).format(1234567.891)Use a plain number with a dot for decimals.
Plain, currency, percent, unit, compact or scientific, with decimal places and sign options.
Copy the formatted text, or the Intl.NumberFormat line that produces it.
Conventions differ: 1,234.5 in the US is 1.234,5 in Germany and 1 234,5 in France. The locale sets the separators and currency placement.
Shortens large numbers the local way: 1,234,567 becomes 1.2M in English and 123万 in Japanese.
In twos after the first thousand: 12,34,567 (twelve lakh thirty-four thousand).
Almost — it uses your browser's built-in locale data, which can differ slightly between browsers and versions.
Length
Convert between miles, kilometres, feet, metres, inches, centimetres, yards and more — exact to the international yard, with a reference table and every unit at once.
Weight
Convert pounds, kilograms, ounces, grams, stones, tons, carats and troy ounces, exact to the international pound (0.45359237 kg).
Temperature
Convert Celsius, Fahrenheit, Kelvin and Rankine with the formula shown, plus an oven temperature and gas mark chart.
Area
Convert acres, hectares, square feet, square metres, square miles and more, with exact factors and a quick-reference table.
Volume
Convert litres, US and UK gallons, quarts, pints, cups, fluid ounces, cubic feet and more — US and imperial units kept separate.
Speed
Convert mph, km/h, m/s, knots and feet per second, with the exact factor and a conversion table.