Skip to content

Instantly share code, notes, and snippets.

@sharkyak
Created February 16, 2017 17:59
Show Gist options
  • Save sharkyak/31650e2f01cf5c6ab4200ea87e1ede63 to your computer and use it in GitHub Desktop.
Save sharkyak/31650e2f01cf5c6ab4200ea87e1ede63 to your computer and use it in GitHub Desktop.
split number with spaces
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