Skip to content
UniKit

Number formatter

Format numbers with thousands separators (western or Indian 12,34,567), configurable rounding modes (half-up, banker's, ceil, floor), scientific notation, SI and binary prefixes, currency symbols with parenthesised negatives, percentages, Chinese uppercase amounts and BigInt grouping.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Input

Every rounding mode scales the number to an integer first, so artifacts like 1.005 × 100 = 100.49999999999999 never leak into the output.

Negative style
Trim trailing zeros

Formatted result

Formatted1,234,567.891
Scientific notation1.23457e+6
SI prefix (decimal)1.23M
Binary prefix (IEC)1.18Mi
Percentage (value × 100)123456789.10%
Chinese uppercase amount壹佰贰拾叁万肆仟伍佰陆拾柒元捌角玖分
Chinese reading一百二十三万四千五百六十七
BigInt grouping1,234,567

What this tool does

  • Write a report or reconcile a ledger: 1234567.891 becomes 1,234,567.891, or 12,34,567 in Indian grouping.
  • Handle money: add a currency symbol, use the accounting parenthesis style for negatives, and get the Chinese uppercase amount for invoices at the same time.
  • Check your rounding rule: half-up and banker's rounding differ by a cent on the same number, and switching modes shows it immediately.
  • Write technical docs: get scientific notation, SI prefixes (1.23M) and binary prefixes (1.18Mi) for one value, plus exact BigInt grouping for arbitrarily long integers.

Example

Input

Number 1234567.891, 3 decimal places, western grouping

Output

Formatted 1,234,567.891; scientific notation 1.23457e+6; SI prefix 1.23M; binary prefix 1.18Mi; percentage 123456789.10%; Chinese uppercase amount 壹佰贰拾叁万肆仟伍佰陆拾柒元捌角玖分; Chinese reading 一百二十三万四千五百六十七; BigInt grouping 1,234,567

Switching to Indian grouping gives 12,34,567.891; with 0 decimal places the same number becomes 1,234,568; entering -1234.5 with the parenthesis style gives (1,234.50).

Frequently asked questions

How do half-up and banker's rounding differ?

Only when the digit after the cut is exactly 5: half-up always rounds away from zero (2.5 → 3), while banker's rounding goes to the nearest even digit (2.5 → 2, 3.5 → 4). Banker's rounding is the IEEE 754 default and avoids a systematic drift in large ledgers, which is why accounting software often uses it.

Why does 1.005 round to 1.01 here?

In binary floating point 1.005 is really 1.00499999999999989…, so multiplying by 100 and truncating would give 100, not 101. The tool removes that residue with toPrecision(15) while scaling, so the result matches decimal intuition (1.01).

What is Indian grouping?

The Indian convention groups the last three digits, then every two digits going left: 1234567 becomes 12,34,567 and 123456789 becomes 12,34,56,789. It is common on invoices and financial statements in India, Pakistan and nearby regions, unlike western three-digit grouping.

What are the rules for the Chinese uppercase amount?

Digits use 零壹贰叁肆伍陆柒捌玖 and units use 拾佰仟万亿. The integer part ends with 元; when 角 or 分 is non-zero they are written out, otherwise the amount ends with 整 (壹佰元整). A zero yuan digit with non-zero 角分 becomes 零元伍角, and internal gaps get a 零 (壹佰元零伍分).

How are very large integers handled?

Integers beyond 2^53 lose precision in a Number, so BigInt grouping runs through a separate BigInt path and stays exact at any length. Plain formatting refuses values with |x| ≥ 1e21, because JavaScript switches to exponential string form there and there is nothing left to group.

Keywords:number formatterthousands separatorindian number formatbankers roundingscientific notationsi prefixchinese uppercase amount数字格式化千分位银行家舍入科学计数法中文大写金额

Related tools