Skip to content

Instantly share code, notes, and snippets.

@bl4de
Created April 29, 2013 11:31
Show Gist options
  • Save bl4de/5481070 to your computer and use it in GitHub Desktop.
Save bl4de/5481070 to your computer and use it in GitHub Desktop.
In one of currently released project there was an issue to display values like 12345 as '12,345' (comma before last 3 digits). That's what I've created:
function formatNumber(_value) {
var _return_value = _value.toLocaleString().replace(/\s/gi, ',');
return _return_value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment