toReadableBytes method
Implementation
toReadableBytes([int precision = 2]) {
var bases = ['', 'K', 'M', 'G', 'T', 'P', 'E'];
if (this == 0) return '0 B';
var base = (log(this) / log(1024)).floor();
var size = (this / pow(1024, base)).toStringAsFixed(precision);
return '$size ${bases[base]}B';
}