Decimal Explicit Conversion (Decimal to UInt32)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

clsCompliantAlternativeM:System.Decimal.ToInt64(System.Decimal)equivalentCodeEntityM:System.Decimal.ToUInt32(System.Decimal)

Defines an explicit conversion of a Decimal to a 32-bit unsigned integer.

This API is not CLS-compliant.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

F# does not support this operator

Parameters

value
Type: System.Decimal

The value to convert.

Return Value

Type: System.UInt32

A 32-bit unsigned integer that represents the converted Decimal.

Exception Condition
OverflowException

value is negative or greater than UInt32.MaxValue.

This operator supports the explicit conversion of a Decimal to a UInt32. The syntax for such explicit conversions is language-dependent, and individual language compilers can provide different implementations and return different results. The example illustrates the different return values when you explicitly convert a Decimal value to a UInt32 value by using C# and Visual Basic. To perform a conversion that is independent of language, you can call the ToUInt32 or the Convert.ToUInt32(Decimal) method.

The following example converts Decimal numbers to UInt32 values by using the explicit Decimal to UInt32 conversion.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: