0

Add commas to large numbers for human readability

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