diff --git a/ATxCommon/Conv.cs b/ATxCommon/Conv.cs index 7d959128aaa841747a018b843c3ba80d54c678cc..dd355f802d5e89434626d41badecce1604674d20 100644 --- a/ATxCommon/Conv.cs +++ b/ATxCommon/Conv.cs @@ -16,7 +16,16 @@ order++; numBytes /= 1024; } + return $"{numBytes:0.#} {suffixes[order]}"; } + + /// <summary> + /// Wrapper to convert megabytes into human-readable size string. + /// See <see cref="BytesToString"/> for more details. + /// </summary> + public static string MegabytesToString(long megaBytes) { + return BytesToString(megaBytes * MegaBytes); + } } -} +} \ No newline at end of file