Skip to content

Instantly share code, notes, and snippets.

@ashrewdmint
Created July 6, 2009 23:31
Show Gist options
  • Save ashrewdmint/141763 to your computer and use it in GitHub Desktop.
Save ashrewdmint/141763 to your computer and use it in GitHub Desktop.
function format_number(number) {
return (new String(number)).split('').reverse().join('').replace(/([0-9]{3})/g, '$1,').replace(/,$/, '').split('').reverse().join('');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment