工具 指南
math 免费 无需注册

数字格式化工具

将任意数字格式化为区域分隔符、科学记数法、工程记数法、文字、缩写、罗马数字等——一次全部完成。

正在加载工具…

关于此工具

输入任意数字——包括非常大或非常小的值——即时查看其各种有用格式:区域分隔符(1,234,567.89)、科学记数法(1.23 × 10⁶)、工程记数法(1.23 × 10⁶)、数字文字(一百二十三万……)、缩写简写(1.23M)、罗马数字(适用于不超过3999的整数)、二进制、十六进制、八进制和百分比。单独的货币格式化工具允许您设置符号前缀并选择小数位数。每种格式化结果都有自己的复制按钮。

使用方法

  1. 1 在输入框中输入或粘贴任意数字——格式即时更新。
  2. 2 滚动格式化结果面板,一次查看所有表示形式。
  3. 3 使用货币部分设置符号和小数精度以进行货币格式化。
  4. 4 点击任意格式旁边的复制图标,将该特定表示形式复制到剪贴板。

One number, every useful representation

A single number can be written in many forms depending on who is reading it. An accountant wants thousands separators; a scientist wants powers of ten; a marketer wants "1.2M"; a programmer wants hexadecimal. This tool takes one input number and renders it simultaneously as locale-formatted text, scientific notation, engineering notation, an abbreviated shorthand, English words, a percentage, a Roman numeral, and binary, hexadecimal, and octal. A separate currency formatter lets you add a symbol and fix the decimal places. Each result has its own copy button.

How each format is computed

FormatRuleExample for 1234567.89
LocaleGroup digits in threes with separators1,234,567.89
ScientificMantissa between 1 and 10 times a power of ten1.234568 × 10^6
EngineeringLike scientific, but the exponent is a multiple of 31.234568 × 10^6
AbbreviatedK/M/B/T/Q suffix for thousands, millions, …1.235M
PercentageMultiply by 100 and add %123,456,789%
RomanInteger part, 1–3999 onlyN/A (out of range)
Binary / Hex / OctalRounded integer in base 2 / 16 / 8(of the rounded integer)

The difference between scientific and engineering notation is worth understanding. Scientific notation always puts one non-zero digit before the decimal point, so the exponent can be any integer. Engineering notation restricts the exponent to multiples of three so the result lines up with metric prefixes — 10^3 is kilo, 10^6 is mega, 10^9 is giga. Engineers prefer it because the power of ten maps directly onto units they actually use.

A worked example with the number 2024

Enter 2024 and the tool shows: locale 2,024; scientific 2.024000 × 10^3; engineering 2.024 × 10^3; abbreviated 2.024K; words two thousand twenty-four; percentage 202,400%; Roman numeral MMXXIV; binary 11111101000; hexadecimal 0x7E8; octal 0o3750. The Roman numeral is built by greedily subtracting the largest values — 2024 = 1000 + 1000 + 10 + 10 + (5−1) → M M X X IV — which is exactly how Roman numerals are constructed.

Limits and rounding you should know about

  • Roman numerals stop at 3,999. Standard Roman numerals have no symbol above M used in this way, so the tool returns N/A for 0, negatives, fractions, and anything 4,000 or larger.
  • Binary, hex, and octal use the integer part only. These bases convert the number rounded to the nearest whole number, so 10.9 is treated as 11. They are also computed on a 32-bit unsigned value, which is the right model for typical programming use but not for arbitrarily huge integers.
  • Words handle decimals as digit-by-digit. 3.14 becomes "three point one four", reading each fractional digit separately — the standard way to speak a decimal.
  • Floating-point precision. Very large or very precise values inherit the limits of the browser's double-precision arithmetic; the tool rounds the mantissa to a sensible number of digits rather than showing meaningless trailing noise.

The currency formatter

The currency panel is separate because it has its own choices. You pick a symbol (default $) and a number of decimal places (default 2). The tool then formats your number with grouped thousands and a fixed decimal count and prepends the symbol — for example 1234.5 with symbol and 2 decimals becomes €1,234.50. Set decimals to 0 for whole-currency display, or higher for currencies and crypto that use more decimal places.

Use cases

  • Writing out cheque or contract amounts where the figure must also appear in words.
  • Reading engineering or lab values in proper scientific or engineering notation.
  • Programming, where you need the same value in decimal, hex, binary, and octal at once.
  • Design and dashboards, grabbing an abbreviated 1.2M label for a compact display.

Everything is calculated in your browser the instant you type, so no number you enter is sent anywhere, and you get all ten formats at once without switching tools.

常见问题

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}