数字千分位正则自动转换

Number.prototype.thousandth = function() {
  return `${this}`.replace(/d{1,3}(?=(d{3})+$)/g, '$&,');
};
原文地址:https://www.cnblogs.com/guxuelong/p/12768726.html