1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-28 15:27:43 +00:00

3.5.169. Oops. Haven't commited in a while :< Did... stuff? And things.

This commit is contained in:
SirStendec 2016-05-06 02:23:12 -04:00
parent 4086a2e9fd
commit 8056463bbe
28 changed files with 908 additions and 508 deletions

View file

@ -467,6 +467,19 @@ module.exports = FFZ.utils = {
return "" + count;
},
format_size: function(bits) {
if(Math.abs(bits) < 1024)
return bits + ' b';
var units = ['Kb','Mb','Gb','Tb','Pb','Eb','Zb','Yb'],
u = -1;
do {
bits /= 1024;
++u;
} while(Math.abs(bits) >= 1024 && u < units.length - 1);
return bits.toFixed(1) + ' ' + units[u];
},
escape_regex: escape_regex,
createElement: function(tag, className, content) {