Provides extension methods for ByteSize
public static class ByteSizeExtensionsInheritance System.Object → ByteSizeExtensions
Considers input as bits
public static Humanizer.ByteSize Bits(this byte input);input System.Byte
Considers input as bits
public static Humanizer.ByteSize Bits(this int input);input System.Int32
Considers input as bits
public static Humanizer.ByteSize Bits(this long input);input System.Int64
Considers input as bits
public static Humanizer.ByteSize Bits(this sbyte input);input System.SByte
Considers input as bits
public static Humanizer.ByteSize Bits(this short input);input System.Int16
Considers input as bits
public static Humanizer.ByteSize Bits(this uint input);input System.UInt32
Considers input as bits
public static Humanizer.ByteSize Bits(this ushort input);input System.UInt16
Considers input as bytes
public static Humanizer.ByteSize Bytes(this byte input);input System.Byte
Considers input as bytes
public static Humanizer.ByteSize Bytes(this double input);input System.Double
Considers input as bytes
public static Humanizer.ByteSize Bytes(this int input);input System.Int32
Considers input as bytes
public static Humanizer.ByteSize Bytes(this long input);input System.Int64
Considers input as bytes
public static Humanizer.ByteSize Bytes(this sbyte input);input System.SByte
Considers input as bytes
public static Humanizer.ByteSize Bytes(this short input);input System.Int16
Considers input as bytes
public static Humanizer.ByteSize Bytes(this uint input);input System.UInt32
Considers input as bytes
public static Humanizer.ByteSize Bytes(this ushort input);input System.UInt16
Considers input as exabytes
public static Humanizer.ByteSize Exabytes(this byte input);input System.Byte
Considers input as exabytes
public static Humanizer.ByteSize Exabytes(this double input);input System.Double
Considers input as exabytes
public static Humanizer.ByteSize Exabytes(this int input);input System.Int32
Considers input as exabytes
public static Humanizer.ByteSize Exabytes(this long input);input System.Int64
Considers input as exabytes
public static Humanizer.ByteSize Exabytes(this sbyte input);input System.SByte
Considers input as exabytes
public static Humanizer.ByteSize Exabytes(this short input);input System.Int16
Considers input as exabytes
public static Humanizer.ByteSize Exabytes(this uint input);input System.UInt32
Considers input as exabytes
public static Humanizer.ByteSize Exabytes(this ushort input);input System.UInt16
Considers input as gigabytes
public static Humanizer.ByteSize Gigabytes(this byte input);input System.Byte
Considers input as gigabytes
public static Humanizer.ByteSize Gigabytes(this double input);input System.Double
Considers input as gigabytes
public static Humanizer.ByteSize Gigabytes(this int input);input System.Int32
Considers input as gigabytes
public static Humanizer.ByteSize Gigabytes(this long input);input System.Int64
Considers input as gigabytes
public static Humanizer.ByteSize Gigabytes(this sbyte input);input System.SByte
Considers input as gigabytes
public static Humanizer.ByteSize Gigabytes(this short input);input System.Int16
Considers input as gigabytes
public static Humanizer.ByteSize Gigabytes(this uint input);input System.UInt32
Considers input as gigabytes
public static Humanizer.ByteSize Gigabytes(this ushort input);input System.UInt16
Turns a byte quantity into human readable form, eg 2 GB
public static string Humanize(this Humanizer.ByteSize input, string? format=null);input ByteSize
format System.String
The string format to use
Turns a byte quantity into human readable form, eg 2 GB
public static string Humanize(this Humanizer.ByteSize input, string? format, System.IFormatProvider? formatProvider);input ByteSize
format System.String
The string format to use
formatProvider System.IFormatProvider
The format provider to use
Turns a byte quantity into human readable form, eg 2 GB
public static string Humanize(this Humanizer.ByteSize input, System.IFormatProvider formatProvider);input ByteSize
formatProvider System.IFormatProvider
The format provider to use
Turns a byte quantity into a composite human-readable form using descending units, e.g. 10 KB 2 B.
public static string HumanizeComposite(this Humanizer.ByteSize input, int precision=2, System.IFormatProvider? formatProvider=null, string separator=" ", bool toWords=false);input ByteSize
The byte quantity to humanize.
precision System.Int32
The maximum number of non-zero parts to return.
formatProvider System.IFormatProvider
The format provider to use. If null, the current culture is used.
separator System.String
The separator to use between parts.
toWords System.Boolean
Uses unit words instead of symbols if true.
System.String
The composite byte quantity.
System.ArgumentOutOfRangeException
precision is less than one.
System.ArgumentNullException
separator is null.
ByteSizeExtensions.HumanizeCompositeWithUnitSystem(this ByteSize, ByteSizeUnitSystem, int, IFormatProvider, string, bool) Method
Turns a byte quantity into composite human-readable form using one explicit unit system.
public static string HumanizeCompositeWithUnitSystem(this Humanizer.ByteSize input, Humanizer.ByteSizeUnitSystem unitSystem, int precision=2, System.IFormatProvider? formatProvider=null, string separator=" ", bool toWords=false);input ByteSize
The byte quantity to humanize.
unitSystem ByteSizeUnitSystem
The unit system to use.
precision System.Int32
The maximum number of non-zero parts to return.
formatProvider System.IFormatProvider
The provider used to format each numeric part and select localized unit words.
separator System.String
The separator to place between parts.
toWords System.Boolean
Uses localized unit words instead of canonical symbols when true.
System.String
The composite humanized byte quantity.
System.ArgumentOutOfRangeException
unitSystem is not defined or precision is less than one.
System.ArgumentNullException
separator is null.
ByteSizeExtensions.HumanizeWithUnitSystem(this ByteSize, ByteSizeUnitSystem, string, IFormatProvider) Method
Turns a byte quantity into human-readable form using an explicit unit system.
public static string HumanizeWithUnitSystem(this Humanizer.ByteSize input, Humanizer.ByteSizeUnitSystem unitSystem, string? format=null, System.IFormatProvider? formatProvider=null);input ByteSize
The byte quantity to humanize.
unitSystem ByteSizeUnitSystem
The unit system to use.
format System.String
The numeric format and optional unit token. For DecimalSi and
BinaryIec, SI/IEC-prefixed unit tokens are matched case-insensitively,
while b and B remain case-sensitive; output uses canonical symbol casing.
Legacy preserves established matching behavior.
formatProvider System.IFormatProvider
The provider used to format the numeric value.
System.String
The humanized byte quantity.
System.ArgumentOutOfRangeException
unitSystem is not defined.
System.FormatException
format is invalid, or selects a token not supported by the selected non-legacy system.
Considers input as kilobytes
public static Humanizer.ByteSize Kilobytes(this byte input);input System.Byte
Considers input as kilobytes
public static Humanizer.ByteSize Kilobytes(this double input);input System.Double
Considers input as kilobytes
public static Humanizer.ByteSize Kilobytes(this int input);input System.Int32
Considers input as kilobytes
public static Humanizer.ByteSize Kilobytes(this long input);input System.Int64
Considers input as kilobytes
public static Humanizer.ByteSize Kilobytes(this sbyte input);input System.SByte
Considers input as kilobytes
public static Humanizer.ByteSize Kilobytes(this short input);input System.Int16
Considers input as kilobytes
public static Humanizer.ByteSize Kilobytes(this uint input);input System.UInt32
Considers input as kilobytes
public static Humanizer.ByteSize Kilobytes(this ushort input);input System.UInt16
Considers input as megabytes
public static Humanizer.ByteSize Megabytes(this byte input);input System.Byte
Considers input as megabytes
public static Humanizer.ByteSize Megabytes(this double input);input System.Double
Considers input as megabytes
public static Humanizer.ByteSize Megabytes(this int input);input System.Int32
Considers input as megabytes
public static Humanizer.ByteSize Megabytes(this long input);input System.Int64
Considers input as megabytes
public static Humanizer.ByteSize Megabytes(this sbyte input);input System.SByte
Considers input as megabytes
public static Humanizer.ByteSize Megabytes(this short input);input System.Int16
Considers input as megabytes
public static Humanizer.ByteSize Megabytes(this uint input);input System.UInt32
Considers input as megabytes
public static Humanizer.ByteSize Megabytes(this ushort input);input System.UInt16
Considers input as pebibytes
public static Humanizer.ByteSize Pebibytes(this byte input);input System.Byte
Considers input as pebibytes
public static Humanizer.ByteSize Pebibytes(this double input);input System.Double
Considers input as pebibytes
public static Humanizer.ByteSize Pebibytes(this int input);input System.Int32
Considers input as pebibytes
public static Humanizer.ByteSize Pebibytes(this long input);input System.Int64
Considers input as pebibytes
public static Humanizer.ByteSize Pebibytes(this sbyte input);input System.SByte
Considers input as pebibytes
public static Humanizer.ByteSize Pebibytes(this short input);input System.Int16
Considers input as pebibytes
public static Humanizer.ByteSize Pebibytes(this uint input);input System.UInt32
Considers input as pebibytes
public static Humanizer.ByteSize Pebibytes(this ushort input);input System.UInt16
Turns a quantity of bytes in a given interval into a rate that can be manipulated
public static Humanizer.ByteRate Per(this Humanizer.ByteSize size, System.TimeSpan interval);size ByteSize
Quantity of bytes
interval System.TimeSpan
Interval to create rate for
Considers input as petabytes
public static Humanizer.ByteSize Petabytes(this byte input);input System.Byte
Considers input as petabytes
public static Humanizer.ByteSize Petabytes(this double input);input System.Double
Considers input as petabytes
public static Humanizer.ByteSize Petabytes(this int input);input System.Int32
Considers input as petabytes
public static Humanizer.ByteSize Petabytes(this long input);input System.Int64
Considers input as petabytes
public static Humanizer.ByteSize Petabytes(this sbyte input);input System.SByte
Considers input as petabytes
public static Humanizer.ByteSize Petabytes(this short input);input System.Int16
Considers input as petabytes
public static Humanizer.ByteSize Petabytes(this uint input);input System.UInt32
Considers input as petabytes
public static Humanizer.ByteSize Petabytes(this ushort input);input System.UInt16
Considers input as terabytes
public static Humanizer.ByteSize Terabytes(this byte input);input System.Byte
Considers input as terabytes
public static Humanizer.ByteSize Terabytes(this double input);input System.Double
Considers input as terabytes
public static Humanizer.ByteSize Terabytes(this int input);input System.Int32
Considers input as terabytes
public static Humanizer.ByteSize Terabytes(this long input);input System.Int64
Considers input as terabytes
public static Humanizer.ByteSize Terabytes(this sbyte input);input System.SByte
Considers input as terabytes
public static Humanizer.ByteSize Terabytes(this short input);input System.Int16
Considers input as terabytes
public static Humanizer.ByteSize Terabytes(this uint input);input System.UInt32
Considers input as terabytes
public static Humanizer.ByteSize Terabytes(this ushort input);input System.UInt16