Skip to content

Instantly share code, notes, and snippets.

@SergSlon
Created September 23, 2015 06:26
Show Gist options
  • Select an option

  • Save SergSlon/4da35f08acaf8b80c7d5 to your computer and use it in GitHub Desktop.

Select an option

Save SergSlon/4da35f08acaf8b80c7d5 to your computer and use it in GitHub Desktop.
Вывод больших чисел для удобства чтения
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