js正则匹配千分位加逗号 效果: 代码: // 千分位加逗号 formatNumber(num) { return String(num).replace(/\B(?=(\d{3})+(?!\d))/g, ','); }