js 去除金额的千位分隔符

export function delcommafy(num) {
  if (num != undefined) {
    num = num.toString();
    num = num.replace(/[ ]/g, ""); //去除空格  
    num = num.replace(/,/gi, '');
    return Number(num);
  }
}

 

posted @ 2018-10-30 18:33  秀&莹&锐  阅读(3418)  评论(0编辑  收藏  举报