Convert.ToUInt32 (Decimal) converts decimal number to 32-bit unsigned integer. : Convert to UInt32 « Development « VB.Net






Convert.ToUInt32 (Decimal) converts decimal number to 32-bit unsigned integer.

  

Class Sample
   Public Shared Sub Main()
        Dim values() As Decimal = { Decimal.MinValue, -1034.23d, -12d, 0d, 147d, _
                                    199.55d, 2010.16d, Decimal.MaxValue }
        Dim result As UInteger
        
        For Each value As Decimal In values
           Try
              result = Convert.ToUInt32(value)
              Console.WriteLine(result)
           Catch e As OverflowException
              Console.WriteLine("{0} is outside the range of the UInt32 type.", _
                                value)
           End Try   
        Next                                  
    End Sub 
End Class 

   
    
  








Related examples in the same category

1.Convert.ToUInt32 (Boolean) converts Boolean to 32-bit unsigned integer.
2.Convert.ToUInt32 (Byte) converts 8-bit unsigned integer to 32-bit unsigned integer.
3.Convert.ToUInt32 (Char) converts Unicode character to 32-bit unsigned integer.
4.Convert.ToUInt32 (Double) converts double-precision floating-point number to 32-bit unsigned integer.
5.Convert.ToUInt32 (Int16) converts 16-bit signed integer to 32-bit unsigned integer.
6.Convert.ToUInt32 (Int32) converts 32-bit signed integer to 32-bit unsigned integer.
7.Convert.ToUInt32 (Int64) converts 64-bit signed integer to 32-bit unsigned integer.
8.Convert.ToUInt32 (Object) converts object to a 32-bit unsigned integer.
9.Convert.ToUInt32 (SByte) converts 8-bit signed integer to 32-bit unsigned integer.
10.Convert.ToUInt32 (Single) converts single-precision floating-point number to 32-bit unsigned integer.
11.Convert.ToUInt32 (String) converts string to 32-bit unsigned integer.
12.Convert.ToUInt32 (String, IFormatProvider) converts string to 32-bit unsigned integer using culture-specific format
13.Convert.ToUInt32 (String, Int32) converts string in a base to 32-bit unsigned integer.
14.Convert.ToUInt32 (UInt64) converts 64-bit unsigned integer to 32-bit unsigned integer.