Windows File Size Formatting
Windows File Size Formatting
API Declarations
'
' Basically, it returns the size nicely formatted, like Windows inFile Properties.
Rate Windows File Size Formatting
(2(2 Vote))
Dim R As String
If s <= (2 ^ 10) Then R = s & " Bytes"
If s > (2 ^ 10) And s <= (2 ^ 20) Then R = Round(s / (2 ^ 10), 2) & " KB"
If s > (2 ^ 20) And s <= (2 ^ 30) Then R = Round(s / (2 ^ 20), 2) & " MB"
If s > (2 ^ 30) And s <= (2 ^ 40) Then R = Round(s / (2 ^ 30), 2) & " GB"
If s > (2 ^ 40) And s <= (2 ^ 50) Then R = Round(s / (2 ^ 40), 2) & " TB"
If s > (2 ^ 50) And s <= (2 ^ 60) Then R = Round(s / (2 ^ 50), 2) & " PB"
ProperSize = R
End Function
Windows File Size Formatting Comments
No comments yet — be the first to post one!
Post a Comment