Mega Code Archive

 
Categories / VB.Net / Development
 

Convert ToDouble (Int32) converts 32-bit signed integer to double-precision floating-point number

Module Example    Public Sub Main()     Dim doubleVal As Double = 123123.123123     Dim intVal As Integer = 0     Try         intVal = System.Convert.ToInt32(doubleVal)         System.Console.WriteLine("{0} as an Integer is: {1}", _                                   doubleVal, intVal)     Catch exception As System.OverflowException         System.Console.WriteLine("Overflow in Double-to-Byte conversion.")     End Try     doubleVal = System.Convert.ToDouble(intVal)     System.Console.WriteLine("{0} as a Double is: {1}",intVal, doubleVal)    End Sub End Module