Convert.ToSingle (Double) converts double number to single-precision floating-point number.
Class Sample
Public Shared Sub Main()
Dim values() As Double = { Double.MinValue, -1.38e10, -1024.299, -12.98,Double.MaxValue }
Dim result As Single
For Each value As Double In values
result = Convert.ToSingle(value)
Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.", _
value.GetType().Name, value, _
result.GetType().Name, result)
Next
End Sub
End Class
Related examples in the same category