PrettyBytes property
String
PrettyBytes
Implementation
String get PrettyBytes {
if(this < 1024)
return '$this Bytes';
else if(this < 1048576)
return (this / 1024).toStringAsFixed(2)+' KB';
else if(this < 1073741824)
return (this / 1048576).toStringAsFixed(2)+' MB';
else if(this < 1099511627776)
return (this / 1073741824).toStringAsFixed(2)+' GB';
else
return (this / 1.09951162e12).toStringAsFixed(2)+' TB';
}