js中数字千位分隔符

xiaoxiao2021-02-28  79

function parseNumber(str){  var re = /(?=(?!\b)(\d{3})+$)/g;  return str.replace(re, ','); 

alert(parseNumber('123456789')); // 123,456,789

转载请注明原文地址: https://www.6miu.com/read-73914.html

最新回复(0)