Click or drag to resize

BinarySizeToString Method (String)

Returns a String that represents this instance.

Namespace:  Ookii.Jumbo
Assembly:  Ookii.Jumbo (in Ookii.Jumbo.dll) Version: 2.0.0
Syntax
public string ToString(
	string format
)

Parameters

format
Type: SystemString
The format.

Return Value

Type: String
A String that represents this instance.
Remarks

The value of format must be a string containing a numeric format string followed by a binary unit, or either one of both. If no numeric format is present, the default is used. If no binary unit is specified, the raw value in bytes is used.

The first character of the binary suffix indicates the scaling factor. This can be one of the normal binary prefixes K, M, G, T, or P. The value A (auto) indicates that the scaling factor should be automatically determined as the largest factor in which this value can be precisely represented with no decimals. The value S (short) indicates that the scaling factor should be automatically determined as the largest possible scaling factor in which this value can be represented with the scaled value being at least 1. Using S may lead to rounding so while this is appropriate for some display scenarios, it is not appropriate if the precise value must be preserved.

The binary prefix can be followed by either B or iB to indicate the the unit formatting.

The casing of the binary unit will be preserved as in the format string. Any whitespace that surrounding the binary unit will be preserved.

See Also