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

KB

Simplest way to get a number of kilobytes.

Source

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

Example

var 10k = 10.KB();

Author: José Fidalgo H.

Submitted on: 13 jun 2013

Language: C#

Type: System.Int32

Views: 2840