Mega Code Archive

 
Categories / VB.Net / Development
 

Convert ToDouble (Single) converts single-precision floating-point number to double-precision floating-point number

Module Example    Public Sub Main()     Dim doubleVal As Double = 123.123     Dim singleVal As Single = 0     singleVal = System.Convert.ToSingle(doubleVal)     System.Console.WriteLine("{0} as a Single is {1}",doubleVal, singleVal)     doubleVal = System.Convert.ToDouble(singleVal)     System.Console.WriteLine("{0} as a Double is: {1}",singleVal, doubleVal)    End Sub End Module