Created
May 25, 2017 20:35
-
-
Save EQuimper/788c958dabd1cf9ff43b79e9c8589c3f to your computer and use it in GitHub Desktop.
Thousand with comma
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
export function commaThousand(num) { | |
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment