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:
parent
4086a2e9fd
commit
8056463bbe
28 changed files with 908 additions and 508 deletions
13
src/utils.js
13
src/utils.js
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue