diff --git a/ATxCommon/Conv.cs b/ATxCommon/Conv.cs index dd355f802d5e89434626d41badecce1604674d20..6ad74cb31ff7233fff6c97e8a21f67848352af99 100644 --- a/ATxCommon/Conv.cs +++ b/ATxCommon/Conv.cs @@ -3,6 +3,7 @@ public static class Conv { public const int MegaBytes = 1024 * 1024; + public const int GigaBytes = MegaBytes * 1024; /// <summary> /// Convert bytes into a human-readable string with the appropriate suffix (up to TB). @@ -27,5 +28,13 @@ public static string MegabytesToString(long megaBytes) { return BytesToString(megaBytes * MegaBytes); } + + /// <summary> + /// Wrapper to convert gigabytes into human-readable size string. + /// See <see cref="BytesToString"/> for more details. + /// </summary> + public static string GigabytesToString(long gigaBytes) { + return BytesToString(gigaBytes * GigaBytes); + } } } \ No newline at end of file