2025 第 32 周

发布:

格式化结果

0¥0.00
1¥1.00
-1-¥1.00
12.3¥12.30
-12.3-¥12.30
1234.5¥1,234.50
123456.789¥123,456.79
当前 Intl 选项(JSON)
{
  "style": "currency",
  "currency": "CNY",
  "currencyDisplay": "symbol",
  "notation": "standard",
  "signDisplay": "auto",
  "useGrouping": true,
  "roundingMode": "halfExpand",
  "roundingPriority": "auto"
}
构造代码片段
const fmt = new Intl.NumberFormat('zh-CN', {
  "style": "currency",
  "currency": "CNY",
  "currencyDisplay": "symbol",
  "notation": "standard",
  "signDisplay": "auto",
  "useGrouping": true,
  "roundingMode": "halfExpand",
  "roundingPriority": "auto"
});
fmt.format(123456.789);