Created
August 28, 2015 00:48
-
-
Save Marzogh/4f89a0a21d83c0a9e616 to your computer and use it in GitHub Desktop.
Easy format to use while converting between different storage sizes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
knownUnits = new Dictionary<string, long> | |
{ | |
{ "", 1L }, // no unit is same as unit B(yte) | |
{ "B", 1L }, | |
{ "KB", 1024L }, | |
{ "MB", 1024L * 1024L}, | |
{ "GB", 1024L * 1024L * 1024L}, | |
{ "TB", 1024L * 1024L * 1024L * 1024L} | |
// fill rest as needed | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment