Option Explicit
' ----------------------------
' Constants & API Declarations
' ----------------------------
Private Declare Function StrFormatByteSize Lib "shlwapi" Alias "StrFormatByteSizeA" (ByVal dw As Long, ByVal pszBuf As String, ByRef cchBuf As Long) As String
' ---------------
' Function
' ---------------
Public Function FormatKB(ByVal Amount As Long) As String
Dim Buffer As String
Dim Result As String
Buffer = Space$(255)
Result = StrFormatByteSize(Amount, Buffer, Len(Buffer))
If InStr(Result, vbNullChar) > 1 Then
FormatKB = Left$(Result, InStr(Result, vbNullChar) - 1)
End If
End Function
Share:
These icons link to social bookmarking sites where readers can share and discover new web pages.
