FormatFileSize(File.Size(....))
Sub FormatFileSize(Bytes As Float) As String
Private Unit() As String = Array As String(" Byte", " Kb", " Mb", " Gb", " Tb", " Pb", " Eb", " Zb", " Yb")
If Bytes = 0 Then
Return "0 Bytes"
Else
Private Po, Si As Double
Private I As Int
Bytes = Abs(Bytes)
I = Floor(Logarithm(Bytes, 1024))
Po = Power(1024, I)
Si = Bytes / Po
Return NumberFormat(Si, 1, 1) & Unit(I)
End If
End Sub