Skip to content

Instantly share code, notes, and snippets.

@Adoonq
Last active July 6, 2018 07:40
Show Gist options
  • Save Adoonq/1a4cc894f2b2a85f38bb47802eebbc71 to your computer and use it in GitHub Desktop.
Save Adoonq/1a4cc894f2b2a85f38bb47802eebbc71 to your computer and use it in GitHub Desktop.
Разделение разрядов числа пробелами
var str = "3830000";
alert(str.replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g, '$1 '));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment