Created
September 23, 2015 06:26
-
-
Save SergSlon/4da35f08acaf8b80c7d5 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
| function slice_concatenate(i){ | |
| var s = i.toString(); | |
| var l = s.length; | |
| var result = ''; | |
| if (l > 15) result += s.slice(-18, -15) + "'"; | |
| if (l > 12) result += s.slice(-15, -12) + "'"; | |
| if (l > 9) result += s.slice(-12, -9) + "'"; | |
| if (l > 6) result += s.slice(-9, -6) + "'"; | |
| if (l > 3) result += s.slice(-6, -3) + "'"; | |
| result += s.slice(-3); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment