Skip to content

Instantly share code, notes, and snippets.

@vdakalov
Created July 24, 2018 13:31
Show Gist options
  • Save vdakalov/e1634a54715d7c21c013f8a34af52f2e to your computer and use it in GitHub Desktop.
Save vdakalov/e1634a54715d7c21c013f8a34af52f2e to your computer and use it in GitHub Desktop.
Разбивка числа по порядкам с помощью регулярного выражения
// еле вспомнил, так что положу тут, что бы не забыть!
1e8.toString().replace(/(\d{1,3})(?=(\d{3})+$)/g, '$1 '); // "100 000 000"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment