Created
April 13, 2018 07:41
-
-
Save MSerj/ad23c73f65e3610bbad96a5ac06d4924 to your computer and use it in GitHub Desktop.
format 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
function numberWithSpaces(nr) { | |
return nr.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " "); | |
} |
oshliaer
commented
Jun 23, 2023
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment