Advertisement
Guest User

YouTube Tycoon number script

a guest
Aug 5th, 2016
1,781
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. nums = ['k','m','b', 't', 'q', 'Q', 's', 'S', 'O', 'N', 'D', 'UD', 'DD', 'TD', 'qD', 'QD', 'sD', 'SD', 'OD', 'ND', 'V', 'UV', 'DV', 'TV', 'qV', 'QV', 'sV', 'SV', 'OV', 'NV', 'T', 'UT', 'DT', 'TT', 'qT', 'QT', 'sT', 'ST', 'OT', 'NT', '~q', 'Uq', 'Dq', 'Tq', 'c', 'C', 'n', 'd', 'aa', 'bb', 'cc', 'dd', 'ee', 'ff', 'gg', 'hh', 'ii', 'jj', 'kk', 'll', 'mm', 'nn', 'oo', 'pp', 'qq', 'rr', 'ss', 'tt', 'uu', 'vv', 'ww', 'xx', 'yy', 'zz', 'AA', 'BB', 'CC', 'DD', 'EE','FF', 'GG','HH','II','JJ','KK','LL','MM','NN','OO','PP','QQ','RR','SS','TT','UU','VV','WW','XX','YY','ZZ','aaa',];
  2.  
  3.  
  4. function Beautify(num,floats)
  5. {
  6. if (!isFinite(num)) return 'Infinity'
  7. if(num < 1e3 || num >= parseFloat('1e' + 3*(nums.length))) return Math.round(num)
  8. var i = 0;
  9. while(num >= 1000)
  10. {
  11. num/=1000;
  12. i++;
  13. }
  14. num = Math.round(num*1000)/1000;
  15. if(num>=1000)
  16. {
  17. num/=1000;
  18. i++;
  19. num = Math.round(num*1000)/1000;
  20. } //deals with rounding errors
  21. num = num.toString();
  22. if(num.indexOf('.') == -1) num += '.000'
  23. else
  24. {
  25. dec = num.indexOf('.');
  26. while(num.slice(dec,num.length).length < 4) num += '0' //adds trailing 0s (if needed) to stop the numbers jumping around.
  27. }
  28. return num + nums[i - 1]
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement