Decimal.GetTypeCode メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As Decimal Dim returnValue As TypeCode returnValue = instance.GetTypeCode
列挙型定数 TypeCode.Decimal。

GetTypeCode メソッドを使用して、Decimal の値の型コードを返す例を次に示します。
' Example of the Decimal.GetTypeCode method. Imports System Imports Microsoft.VisualBasic 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
// 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. 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. import System.*; class DecimalGetTypeCodeDemo { public static void main(String[] args) { Console.WriteLine("This example of the " + "decimal.GetTypeCode( ) \nmethod " + "generates the following output.\n"); // Create a decimal object and get its type code. System.Decimal aDecimal = new System.Decimal(1.0); TypeCode typCode = aDecimal.GetTypeCode(); Console.WriteLine("Type Code: \"{0}\"", typCode); Console.WriteLine("Numeric value: {0}", System.Convert.ToString((int)typCode)); } //main } //DecimalGetTypeCodeDemo /* This example of the decimal.GetTypeCode( ) method generates the following output. Type Code: "Decimal" Numeric value: 15 */

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- Decimal.GetTypeCode メソッドのページへのリンク