Skip to content

Instantly share code, notes, and snippets.

@alanjuden
Created January 21, 2014 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanjuden/8549709 to your computer and use it in GitHub Desktop.
Save alanjuden/8549709 to your computer and use it in GitHub Desktop.
ByteConversion.GetString(2147483648, ByteUnit.Byte); //Returns "2 GB"
ByteConversion.GetString(2048, ByteUnit.Megabyte, ByteUnit.Byte); //Returns "2147483648 B"
ByteConversion.GetString(2147483648, ByteUnit.Byte, ByteUnit.Megabyte); //Returns "2048 MB"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment