This is the version using a loop:
'Variante 2 (using loop)
'call with MakeNiceSize(YourSizeInBytes)
Function MakeNiceSize(ByVal size As Double)
Dim suffix() As String = {"B", "KB", "MB", "GB", "TB", "PB", "EB"}
Dim run As Integer = 0
While size >= 1024
size /= 1024
run += 1
End While
Return Math.Round(size, 2).ToString("00.00") & " " & suffix(run)
End Function