Skip to content

Instantly share code, notes, and snippets.

@Security2431
Created April 25, 2018 06:40
Show Gist options
  • Save Security2431/bacbc65686ac8da89e64fcffffa9ace9 to your computer and use it in GitHub Desktop.
Save Security2431/bacbc65686ac8da89e64fcffffa9ace9 to your computer and use it in GitHub Desktop.
Thousends prettify separator
prettify(num) {
const n = num.toString()
return n.replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g, "$1" + " ")
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment