C# Decimal GetTypeCode

Description

Decimal GetTypeCode returns the TypeCode for value type Decimal.

Syntax

Decimal.GetTypeCode has the following syntax.


public TypeCode GetTypeCode()

Returns

Decimal.GetTypeCode method returns The enumerated constant TypeCode.Decimal.

Example

Example of the decimal.GetTypeCode method.


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

class MainClass
{
    public static void Main( )
    {
        decimal aDecimal = new decimal( 1.0 );
        TypeCode typCode = aDecimal.GetTypeCode( );

        Console.WriteLine( "Type Code:      \"{0}\"", typCode );
        Console.WriteLine( "Numeric value:  {0}", (int)typCode );
    }
}

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