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.