Convert Bytes into K, MB, GB
Convert Bytes into K, MB, GB
Rate Convert Bytes into K, MB, GB
(2(2 Vote))
Dim nBytes
Dim nBytes2
Dim nBytesConverted
nBytes = Val(cBytes / 1024)
nBytes2 = Val(nBytes / 1024)
Select Case Len(cBytes)
Case 1, 2, 3
'BYTES
nBytesConverted = cBytes & " Bytes"
Case 4, 5, 6
'KILO BYTES
nBytesConverted = Format((cBytes / 1024), "0.00 K")
Case Else
If Len(nBytes2) <= 3 Then
'MEGA BYTES
nBytesConverted = Format((nBytes2), "0 MB")
Else
'GIGA BYTES
nBytesConverted = Format((nBytes2 / 1024), "0.00 GB")
End If
End Select
ConvertBytes = nBytesConverted
End Function
Convert Bytes into K, MB, GB Comments
No comments yet — be the first to post one!
Post a Comment