Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

StrFormatByteSizeEx function

Converts a numeric value into a string that represents the number in bytes, kilobytes, megabytes, or gigabytes, depending on the size. Extends StrFormatByteSizeW by offering the option to round to the nearest displayed digit or to discard undisplayed digits.

Syntax


HRESULT StrFormatByteSizeEx(
  ULONGLONG ull,
  SFBS_FLAGS flags,
  _Out_  PWSTR pszBuf,
  UINT cchBuf
);

Parameters

ull

Type: ULONGLONG

The numeric value to be converted.

flags

Type: SFBS_FLAGS

One of the SFBS_FLAGS enumeration values that specifies whether to round or truncate undisplayed digits. This value cannot be NULL.

pszBuf [out]

Type: PWSTR

A pointer to a buffer that receives the converted string.

cchBuf

Type: UINT

The size of the buffer pointed to by pszBuf, in characters.

Return value

Type: HRESULT

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

Remarks

The following table illustrates how this function converts a numeric value into a text string in relation to the passed flag.

Numeric valueFlagText string
2147483647SFBS_FLAGS_ROUND_TO_NEAREST_DISPLAYED_DIGIT2.00 GB
2147483647SFBS_FLAGS_TRUNCATE_UNDISPLAYED_DECIMAL_DIGITS1.99 GB

 

Requirements

Minimum supported client

Windows Vista with SP1 [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Shlwapi.h

Library

Shlwapi.lib

DLL

Shlwapi.dll (version 6.0 or later)

See also

StrFormatByteSize64
StrFormatByteSizeA
StrFormatByteSizeW

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.