private static string FormatBytes(long bytes)
{
string[] sizes = { "B", "KB", "MB", "GB", "TB", "PB" };
var order = 0;
while (bytes >= 1024 && order < sizes.Length - 1)
{
order++;
bytes /= 1024;
}
return $"{bytes:0.##} {sizes[order]}";
}