How to convert terabytes to petabytes in VB.NET

1 Answer

0 votes
Imports System

Public Class TerabytesToPetabytes_VB_NET
    Public Shared Function TerabytesToPetabytes(ByVal terabytes As Long) As Double
        Return terabytes / 1024F
    End Function

	Public Shared Sub Main()
        Dim tb1 As Integer = 1398
        Dim tb2 As Integer = 10
		
        Console.WriteLine("{0:N2}PB", TerabytesToPetabytes(tb1))
        Console.WriteLine("{0:N4}PB", TerabytesToPetabytes(tb2))
    End Sub
End Class



' run:
'
' 1.37PB
' 0.0098PB
' 

 



answered Nov 24, 2024 by avibootz

Related questions

1 answer 185 views
1 answer 177 views
1 answer 257 views
257 views asked Sep 14, 2020 by avibootz
1 answer 257 views
...