Skip to content

Instantly share code, notes, and snippets.

@d48
Created June 28, 2012 22:12
Show Gist options
  • Save d48/3014315 to your computer and use it in GitHub Desktop.
Save d48/3014315 to your computer and use it in GitHub Desktop.
number with commas
numberWithCommas: function(num) {
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment