displayText property
String
get
displayText
Implementation
String get displayText => (() {
var lvB = BigInt.from(1);
var lvKB = lvB * standard.getLevelBase();
var lvMB = lvKB * standard.getLevelBase();
var lvGB = lvMB * standard.getLevelBase();
var lvTB = lvGB * standard.getLevelBase();
var lvPB = lvTB * standard.getLevelBase();
var lvEB = lvPB * standard.getLevelBase();
var lvZB = lvEB * standard.getLevelBase();
var iecIdentity = standard is BinarySizeIecStandard ? 'i' : '';
if (bytesCount < lvKB) return '$bytesCount B';
if (bytesCount < lvMB) return '${(bytesCount / lvKB).toStringAsFixed(2)} K${iecIdentity}B';
if (bytesCount < lvGB) return '${(bytesCount / lvMB).toStringAsFixed(2)} M${iecIdentity}B';
if (bytesCount < lvTB) return '${(bytesCount / lvGB).toStringAsFixed(2)} G${iecIdentity}B';
if (bytesCount < lvPB) return '${(bytesCount / lvTB).toStringAsFixed(2)} T${iecIdentity}B';
if (bytesCount < lvEB) return '${(bytesCount / lvPB).toStringAsFixed(2)} P${iecIdentity}B';
if (bytesCount < lvZB) return '${(bytesCount / lvEB).toStringAsFixed(2)} E${iecIdentity}B';
return '${(bytesCount / lvZB).toStringAsFixed(2)} Z${iecIdentity}B';
})();