0

Add commas to large numbers for human readability

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