-
-
Save Nikolasgrizli/c47176c847cb0aa99164da2893e8b66f to your computer and use it in GitHub Desktop.
разделение суммы на тройки пробелами
This file contains 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
function number_format(str) { | |
return str.replace(/(\s)+/g, '').replace(/(\d{1,3})(?=(?:\d{3})+$)/g, '$1 '); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment