function formatDataSize(kb) {
if (kb == '')
return "";
kb = parseInt(kb);
var mb = kb / 1024;
if (mb >= 1)
return formatFloat(mb, 2) + " MB";
else
return kb + " KB";
}
function formatFloat(num, pos) {
var size = Math.pow(10, pos);
return Math.round(num * size) / size;
}
沒有留言:
張貼留言