在网上搜罗的金额格式化方法

方法一

    function toThousands(num) {
        var num = (num || 0).toString(), result = '';
        while (num.length > 3) {
            result = ',' + num.slice(-3) + result;
            num = num.slice(0, num.length - 3);
        }
        if (num) { result = num + result; }
        return result;
    }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-31
  • 2021-08-26
  • 2021-08-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-07
  • 2021-07-16
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案