Created
February 16, 2017 17:59
-
-
Save sharkyak/31650e2f01cf5c6ab4200ea87e1ede63 to your computer and use it in GitHub Desktop.
split number with spaces
This file contains hidden or 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
var parts = data.toString().split("."); | |
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, " "); | |
return parts.join("."); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment