钱数三位数添加逗号

toThousandFilter(num) {
      return (+num || 0).toFixed(2).replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
    }

 

posted @ 2021-06-07 16:03  落灯花  阅读(107)  评论(0编辑  收藏  举报