Guest User

Untitled

a guest
Jul 16th, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. formatNum:function(num){
  2. var num = (num || 0).toString(), result = '';
  3. while (num.length > 3) {
  4. result = ',' + num.slice(-3) + result;
  5. num = num.slice(0, num.length - 3);
  6. }
  7. if (num) { result = num + result; }
  8. return result;
  9. }
Add Comment
Please, Sign In to add comment