'a'
mh-two-thousand-and-two
2024-04-12 44d2c92345cd156a59fc327b3060292a282d2893
1
2
3
4
5
6
7
8
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;