初始化fy
This commit is contained in:
9
uni_modules/UniDevTools/node_modules/licia/fileSize.js
generated
vendored
Normal file
9
uni_modules/UniDevTools/node_modules/licia/fileSize.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
exports = function(bytes) {
|
||||
if (bytes <= 0) return '0';
|
||||
var suffixIdx = Math.floor(Math.log(bytes) / Math.log(1024));
|
||||
var val = bytes / Math.pow(2, suffixIdx * 10);
|
||||
return +val.toFixed(2) + suffixList[suffixIdx];
|
||||
};
|
||||
var suffixList = ['', 'K', 'M', 'G', 'T'];
|
||||
|
||||
module.exports = exports;
|
||||
Reference in New Issue
Block a user