How to convert bytes to MB in VB.NET

1 Answer

0 votes
Imports System

Public Class Program
	Public Shared Sub Main()
        Dim bytes As Long = 43839792
		
        Dim mb As Double = bytes / 1024.0 / 1024.0
		
        Console.Write("{0:0.00} MB", mb)
    End Sub
End Class


	
	
	
' run:
'
' 41.81 MB
'

 



answered Aug 20, 2023 by avibootz
...