Decimal.GetTypeCode Méthode
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
public:
virtual TypeCode GetTypeCode();
public TypeCode GetTypeCode ();
abstract member GetTypeCode : unit -> TypeCode
override this.GetTypeCode : unit -> TypeCode
Public Function GetTypeCode () As TypeCode
Constante énumérée, Decimal.
L’exemple de code suivant utilise la GetTypeCode
méthode pour retourner le code de type valeur 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.
open System
printfn $"This example of the decimal.GetTypeCode() \nmethod generates the following output.\n"
// Create a decimal object and get its type code.
let aDecimal = Decimal 1.0
let typCode = aDecimal.GetTypeCode()
printfn $"Type Code: \"{typCode}\""
printfn $"Numeric value: {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
Produit | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
Commentaires sur .NET
.NET est un projet open source. Sélectionnez un lien pour fournir des commentaires :