//byte 转bkmgt
byteconvert:function (bytes){ var i = 0; var KBRule=1024; var j = "BKMGT"; while (bytes>KBRule) { bytes=bytes/KBRule; i++; } return bytes.toFixed(1) + j.charAt(i); }本文共 227 字,大约阅读时间需要 1 分钟。
//byte 转bkmgt
byteconvert:function (bytes){ var i = 0; var KBRule=1024; var j = "BKMGT"; while (bytes>KBRule) { bytes=bytes/KBRule; i++; } return bytes.toFixed(1) + j.charAt(i); }转载于:https://my.oschina.net/u/937111/blog/748990