Skip to content
Snippets Groups Projects
Commit 6831233b authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Add const and method for converting GigaBytes.

Refers to #24
parent e676cc01
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment