Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- formatNum:function(num){
- var num = (num || 0).toString(), result = '';
- while (num.length > 3) {
- result = ',' + num.slice(-3) + result;
- num = num.slice(0, num.length - 3);
- }
- if (num) { result = num + result; }
- return result;
- }
Add Comment
Please, Sign In to add comment