|
|
Title | Format a number of bytes in KB, MB, and GB by using StrFormatByteSize |
Description | |
Keywords | format, bytes, KB, MB, GB, StrFormatByteSize |
Categories | API, Files and Directories |
|
|
Use the StrFormatByteSize API function.
|
|
' Return a formatted string representing
' the number of bytes.
Private Function FormatBytes(ByVal num_bytes As Long) As _
String
Dim txt As String
txt = Space$(256)
StrFormatByteSize num_bytes, txt, Len(txt)
FormatBytes = Left$(txt, InStr(txt, vbNullChar) - 1)
End Function
|
|
See also:
|
|
|
|
|
|