📜  javascript代码示例中的格式金额

📅  最后修改于: 2022-03-11 15:04:23.944000             🧑  作者: Mango

代码示例2
function numberWithCommas(x) {
    return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}