0

Add commas to large numbers for human readability

Function JavaScript 1 revisions 122 10 months ago 10 months ago
function numberWithCommas(x) {
  return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}