This is a little vb.net
৺snippet, to create a nice file size
'Variant one (original)
'call with MakeNiceSize(YourSizeInBytes, "0")
Public suffix() As String = {"B", "KB", "MB", "GB", "TB", "PB", "EB"}
Function MakeNiceSize(ByVal size As Double, ByVal run As Integer)
Dim ReturnedString As String = ""
If size >= 1024 Then
ReturnedString = MakeNiceSize(size / 1024, run + 1)
Else
ReturnedString = Math.Round(size, 2).ToString("00.00") & " " & suffix(run)
End If
Return ReturnedString
End Function