Last active
March 31, 2019 16:03
-
-
Save SashaKolbasov/1f153adf5a6594e687dfe30afbbfcdc4 to your computer and use it in GitHub Desktop.
Thousands Separator
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
var price = Math.floor(price) + ''; | |
price = price.replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g, '$1 '); | |
function sep(n){return n.replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g,'$1 ');} | |
function rmm(min,max){return Math.floor(Math.random()*(max-min+1))+min;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment