TTKTheTextKit

Number Formatter

Paste numbers, one per line, and choose how to write them: with commas for thousands and a point for decimals, with points and a decimal comma, with spaces, with apostrophes, in the Indian style or with no separators at all. Set a number of decimals to round to, and add a prefix such as a currency symbol or a suffix such as a percent sign. Numbers that already have separators in any style are read correctly. Everything runs in your browser.

Result
NumberFormatted
1234567.8911,234,567.891
-9876543.21-9,876,543.21
0.50.5
10000001,000,000
1234567812,345,678

The numbers are handled as strings of digits, so a long number is never rounded by floating point, and a number of decimals rounds half away from zero. Detect reads 1,234.56 and 1.234,56 correctly because the mark that comes last is the decimal mark, and a lone comma is a thousands mark when exactly three digits follow it (1,234) and a decimal comma otherwise (12,5). A lone point is always a decimal point, so choose Decimal comma for a number such as 1.234 that uses the point for thousands. Spaces, apostrophes, underscores and a leading currency symbol are ignored when reading. ISO 80000-1 allows either a comma or a point as the decimal sign, and the SI style groups digits in threes with a space, for which Unicode recommends the narrow no-break space. The Indian style groups the last three digits and then pairs, so 12,34,567 is 12 lakh 34 thousand 567. Everything runs in your browser.

Related Tools

[5 suggestions]

About the Number Formatter

The numbers are handled as strings of digits, so a long number is never rounded by floating point, and rounding to a number of decimals is half away from zero. The number 1234567.891 becomes 1,234,567.891 in the US style, 1.234.567,891 with a decimal comma, 1 234 567,891 with spaces and 12,34,567.891 in the Indian style. The Indian system groups the last three digits and then pairs, so 12,34,567 is 12 lakh 34 thousand 567, where a lakh is 100,000 and a crore is 10,000,000. ISO 80000-1 allows either a comma or a point as the decimal sign, the SI style groups digits in threes with a space, and Unicode recommends the narrow no-break space for that space. Switzerland writes currency amounts with an apostrophe between groups and a point for decimals, as in 1'234'567.89. When you paste numbers, the mark that comes last is the decimal mark if both appear, a lone comma followed by exactly three digits is a thousands mark, and a lone point is a decimal point. For a number such as 1.234 that uses a point for thousands, choose Decimal comma. Rounding 2.675 to two decimals gives 2.68, and 999.999 to two decimals gives 1,000.00.

How do I add commas to a number?▾

Paste the number and keep the US style, which writes 1234567.891 as 1,234,567.891. The tool groups the whole part in threes and keeps the decimals as typed, or rounds them if you set a number of decimals.

How do I change a decimal comma to a decimal point?▾

Paste the number, for example 1.234,56, and choose the style 1,234.56. The tool reads the last separator as the decimal mark, so it gives 1,234.56. If a number such as 1.234 is meant to be 1234, choose Decimal comma for the numbers you paste.

What is the Indian number format?▾

It groups the last three digits and then pairs of digits, so 1234567 is written 12,34,567. A lakh is 1,00,000 and a crore is 1,00,00,000. 12,34,56,789 reads as 12 crore, 34 lakh, 56 thousand, 789.

How does it round decimals?▾

Half away from zero, working on the digits, so 2.675 becomes 2.68 and -2.675 becomes -2.68. A result of zero never shows a minus sign, and 999.999 rounded to two decimals carries over to 1,000.00.

Is my data uploaded?▾

No. The numbers are formatted in your browser and nothing you enter is sent anywhere.