Created
July 24, 2018 13:31
-
-
Save vdakalov/e1634a54715d7c21c013f8a34af52f2e to your computer and use it in GitHub Desktop.
Разбивка числа по порядкам с помощью регулярного выражения
This file contains hidden or 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
// еле вспомнил, так что положу тут, что бы не забыть! | |
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