ShlwApiStrFormatByteSizeEx Method

Converts a numeric value into a string that represents the number expressed as a size value in bytes, kilobytes, megabytes, gigabytes, petabytes or exabytes, depending on the size.

Extends StrFormatByteSizeW by offering the option to round to the nearest displayed digit or to discard undisplayed digits.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("ShlwApi.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
public static HResult StrFormatByteSizeEx(
	ulong number,
	StrFormatByteSizeFlags flags,
	StringBuilder buffer,
	uint bufferSize
)

Parameters

number  UInt64
The numeric value to be converted.
flags  StrFormatByteSizeFlags
Specifies whether to round or truncate undisplayed digits.
buffer  StringBuilder
A pointer to a buffer that, when this function returns successfully, receives the converted number.
bufferSize  UInt32
The size of buffer, in characters.

Return Value

HResult
If this function succeeds, it returns S_OK. Otherwise, it returns an HResult error code.

Remarks

See Also