标签:pre code size length div byte === style 脚本
if (bytes === 0)
return ‘0 B‘;
var k = 1024,
sizes = [‘B‘, ‘KB‘, ‘MB‘, ‘GB‘, ‘TB‘, ‘PB‘, ‘EB‘, ‘ZB‘, ‘YB‘],
i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)).toPrecision(3) + sizes[i];
?
标签:pre code size length div byte === style 脚本
原文地址:https://www.cnblogs.com/ytxiao/p/9070456.html