ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

MB

Simplest way to get a number of megabytes.

Source

/// <summary>
/// Megabytes
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static int MB(this int value)
{
	return value.KB() * 1024;
}

Example

//You need the KB extension also.

var 1mb = 1.MB();

Author: José Fidalgo H.

Submitted on: 13 jun. 2013

Language: C#

Type: System.Int32

Views: 5028