处理成金额格式

Number.prototype.toLocaleString()

(999999999).toLocaleString(); // 999,999,999
 
// 还可以加参数,进行更优雅的做法
const options = {
  style: 'currency',//  style: 'currency'注释掉就没有 ¥ 符号
  currency: 'CNY',
};
(999999).toLocaleString('zh-CN', options); // ¥999,999.00