js数字千位分隔符

         function toThousands(num) {
     	    return (num || 0).toString().replace(/(d)(?=(?:d{3})+$)/g, '$1,');
     	}

  

原文地址:https://www.cnblogs.com/loveAnimal/p/10482715.html