Created
April 29, 2013 11:31
-
-
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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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