C# Decimal Explicit(Decimal to UInt32)

Description

Decimal Explicit(Decimal to UInt32) defines an explicit conversion of a Decimal to a 32-bit unsigned integer.

Syntax

Decimal.Explicit(Decimal to UInt32) has the following syntax.


public static explicit operator uint (
  decimal value
)

Parameters

Decimal.Explicit(Decimal to UInt32) has the following parameters.

  • value - The value to convert.

Returns

Decimal.Explicit(Decimal to UInt32) method returns A 32-bit unsigned integer that represents the converted Decimal.

Example

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


using System;/* w  ww.  j  a va  2 s. c o m*/

class MainClass
{
    public static void Main( )
    {
        object Int32Value;
        object UInt32Value;

        Int32Value = (int)123.999M;
        UInt32Value = (uint)123.999M;
        Console.WriteLine(Int32Value);
        Console.WriteLine(UInt32Value );

    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version