Skip to content

Instantly share code, notes, and snippets.

@jibone
Created April 17, 2013 08:35
Show Gist options
  • Save jibone/5402750 to your computer and use it in GitHub Desktop.
Save jibone/5402750 to your computer and use it in GitHub Desktop.
add commas to long numbers.
numberCommas = (x) ->
return x.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