lib/common/streams/speedsummary.js
function toHumanReadableSize(size, len) {
  if(!size) return '0B';
  if (!len || len <= 0) {
    len = 2;
  }
  var units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
  var i = Math.floor( Math.log(size) / Math.log(1024));
  return (size/Math.pow(1024, i)).toFixed(len) + units[i];
}
function toHumanReadableSize(size, len) {
  if(!size) return '0B';
  if (!len || len <= 0) {
    len = 2;
  }
  var units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
  var i = Math.floor( Math.log(size) / Math.log(1024));
  return (size/Math.pow(1024, i)).toFixed(len) + units[i];
}
function toHumanReadableSize ( size , len ) { if ( ! size ) return '0B' ; if ( ! len || len <= 0 ) { len = 2 ; } var units = [ 'B' , 'KB' , 'MB' , 'GB' , 'TB' , 'PB' , 'EB' , 'ZB' , 'YB' ] ; var i = Math . floor ( Math . log ( size ) / Math . log ( 1024 ) ) ; return ( size / Math . pow ( 1024 , i ) ) . toFixed ( len ) + units [ i ] ; }
Convert the size to human readable size
Convert the size to human readable size