Server.Gumps.AdminGump.FormatByteAmount C# (CSharp) Méthode

FormatByteAmount() public static méthode

public static FormatByteAmount ( long totalBytes ) : string
totalBytes long
Résultat string
		public static string FormatByteAmount( long totalBytes )
		{
			if ( totalBytes > 1000000000 )
				return String.Format( "{0:F1} GB", (double)totalBytes / 1073741824 );

			if ( totalBytes > 1000000 )
				return String.Format( "{0:F1} MB", (double)totalBytes / 1048576 );

			if ( totalBytes > 1000 )
				return String.Format( "{0:F1} KB", (double)totalBytes / 1024 );

			return String.Format( "{0} Bytes", totalBytes );
		}