// https://www.apiref.com/javascript-zh/Reference/Global_Objects/Number/toLocaleString.htm
const a = 12345678.23
// 数字分割 12,345,678.23
console.log(a.toLocaleString());
// 转化为百分号 1,234,567,823%
console.log(a.toLocaleString('zh', {
style: 'percent'
}));
// 货币表示 ¥12,345,678.23
console.log(a.toLocaleString('zh', {
style: 'currency',
currency: 'cny'
}));
// 货币表示 CNY 12,345,678.23
console.log(a.toLocaleString('zh', {
style: 'currency',
currency: 'cny',
currencyDisplay: 'code'
}));
// 货币表示 12,345,678.23人民币
console.log(a.toLocaleString('zh', {
style: 'currency',
currency: 'cny',
currencyDisplay: 'name'
}));
console