Here is an alternate I like to use.
Private Function TranslateFileSize(ByVal size As Double) As String
Try
Dim filesizename() As String = {" Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB"}
Dim pow As Double = Math.Floor(Math.Log(size, 1024))
Return String.Concat(Math.Round(size / Math.Pow(1024, pow), 2), " ", filesizename(CInt(pow)))
Catch ex As Exception
Return size
End Try
End Function
I first got hooked on programing with the TI994A. After it finally lost all support I reluctantly moved to the Apple IIe. Thank You BeagleBros for getting me through. I wrote programs for my Scuba buisness during this time. Currently I am a Database manager and software developer. I started with VBA and VB6 and now having fun with VB.NET/WPF/C#...