Decimal.GetTypeCode メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
public:
virtual TypeCode GetTypeCode();
public TypeCode GetTypeCode ();
abstract member GetTypeCode : unit -> TypeCode
override this.GetTypeCode : unit -> TypeCode
Public Function GetTypeCode () As TypeCode
戻り値
列挙型定数 Decimal。
実装
例
次のコード例では、 メソッド GetTypeCode
を使用して、値型の型コード Decimal
を返します。
// Example of the Decimal::GetTypeCode method.
using namespace System;
int main()
{
Console::WriteLine( "This example of the "
"Decimal::GetTypeCode( ) \nmethod "
"generates the following output.\n" );
// Create a Decimal object and get its type code.
Decimal aDecimal = Decimal(1.0);
TypeCode typCode = aDecimal.GetTypeCode();
Console::WriteLine( "Type Code: \"{0}\"", typCode );
Console::WriteLine( "Numeric value: {0}", (int)typCode );
}
/*
This example of the Decimal::GetTypeCode( )
method generates the following output.
Type Code: "Decimal"
Numeric value: 15
*/
// Example of the decimal.GetTypeCode method.
using System;
class DecimalGetTypeCodeDemo
{
public static void Main( )
{
Console.WriteLine( "This example of the " +
"decimal.GetTypeCode( ) \nmethod " +
"generates the following output.\n" );
// Create a decimal object and get its type code.
decimal aDecimal = new decimal( 1.0 );
TypeCode typCode = aDecimal.GetTypeCode( );
Console.WriteLine( "Type Code: \"{0}\"", typCode );
Console.WriteLine( "Numeric value: {0}", (int)typCode );
}
}
/*
This example of the decimal.GetTypeCode( )
method generates the following output.
Type Code: "Decimal"
Numeric value: 15
*/
' Example of the Decimal.GetTypeCode method.
Module DecimalGetTypeCodeDemo
Sub Main( )
Console.WriteLine( "This example of the " & _
"Decimal.GetTypeCode( ) " & vbCrLf & "method " & _
"generates the following output." & vbCrLf )
' Create a Decimal object and get its type code.
Dim aDecimal As Decimal = New Decimal( 1.0 )
Dim typCode As TypeCode = aDecimal.GetTypeCode( )
Console.WriteLine( "Type Code: ""{0}""", typCode )
Console.WriteLine( "Numeric value: {0}", CInt( typCode ) )
End Sub
End Module
' This example of the Decimal.GetTypeCode( )
' method generates the following output.
'
' Type Code: "Decimal"
' Numeric value: 15