Convert.ToUInt32 (Single) converts single-precision floating-point number to 32-bit unsigned integer.
Class Sample
Public Shared Sub Main()
Dim values() As Single = { Single.MinValue, -1.38e10, -1023.299, -12.98, _
0, 9.113e-16, 103.919, 17834.191, Single.MaxValue }
Dim result As UInteger
For Each value As Single In values
Try
result = Convert.ToUInt32(value)
Console.WriteLine(result)
Catch e As OverflowException
Console.WriteLine("The {0} value {1} is outside the range of the UInt32 type.", _
value.GetType().Name, value)
End Try
Next
End Sub
End Class
Related examples in the same category