The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Decimal.GetTypeCode Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Returns the TypeCode for value type Decimal.

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

public TypeCode GetTypeCode()

Return Value

Type: System.TypeCode
The enumerated constant TypeCode.Decimal.



The following code example uses the GetTypeCode method to return the type code for Decimal value type.

// Example of the decimal.GetTypeCode method. 
using System;

class Example
   public static void Demo(System.Windows.Controls.TextBlock outputBlock)
      outputBlock.Text += "This example of the " +
          "decimal.GetTypeCode( ) \nmethod " +
          "generates the following output.\n" + "\n";

      // Create a decimal object and get its type code.
      decimal aDecimal = new decimal(1.0);
      TypeCode typCode = aDecimal.GetTypeCode();

      outputBlock.Text += String.Format("Type Code:      \"{0}\"", typCode) + "\n";
      outputBlock.Text += String.Format("Numeric value:  {0}", (int)typCode) + "\n";

This example of the decimal.GetTypeCode( )
method generates the following output.

Type Code:      "Decimal"
Numeric value:  15

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone