

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Decimal.GetTypeCode() Method in C# with Examples
<p>The Decimal.GetTypeCode() method in C# is used to returns the TypeCode for value type Decimal.</p><h2>Syntax</h2><p>Following is the syntax −</p><pre class="result notranslate">public TypeCode GetTypeCode ();</pre><h2>Example</h2><p>Let us now see an example to implement the Decimal.GetTypeCode() method −</p><!--<p><a href="" target="_blank" rel="nofollow" class="demo"><i class="fa-external-link"></i> Live Demo</a></p>--><pre class="prettyprint notranslate">using System; public class Demo { public static void Main(){ Decimal val = Decimal.MaxValue; Console.WriteLine("Decimal Value = {0}", val); Console.WriteLine("HashCode = {0}", (val.GetHashCode()) ); TypeCode type = val.GetTypeCode(); Console.WriteLine("TypeCode = "+type); } }</pre><h2>Output</h2><p>This will produce the following output −</p><pre class="result notranslate">Decimal Value = 79228162514264337593543950335 HashCode = 1173356544 TypeCode = Decimal</pre><h2>Example</h2><p>Let us now see another example to implement the Decimal.GetTypeCode() method −</p><!--<p><a href="" target="_blank" rel="nofollow" class="demo"><i class="fa-external-link"></i> Live Demo</a></p>--><pre class="prettyprint notranslate">using System; public class Demo { public static void Main(){ Decimal val = 3972.491M; Console.WriteLine("Decimal Value = {0}", val); Console.WriteLine("HashCode = {0}", (val.GetHashCode()) ); TypeCode type = val.GetTypeCode(); Console.WriteLine("TypeCode = "+type); } }</pre><h2>Output</h2><p>This will produce the following output −</p><pre class="result notranslate">Decimal Value = 3972.491 HashCode = 620041307 TypeCode = Decimal</pre>
- Related Questions & Answers
- Int64.GetTypeCode Method in C# with Examples
- UInt16.GetTypeCode() Method in C# with Examples
- Int32.GetTypeCode Method in C# with Examples
- UInt64.GetTypeCode() Method in C# with Examples
- UInt32.GetTypeCode() Method in C# with Examples
- Int16.GetTypeCode Method in C# with Examples
- C# Object.GetType() Method with Examples
- C# Queue.TrimExcess() Method with Examples
- C# Stack.TrimExcess() Method with Examples
- C# Object.GetHashCode() Method with Examples
- Java toDegrees() method with Examples
- jQuery not() method with Examples
- JavaScript removeEventListener() method with examples
- Java signum() method with Examples
- Java lang.Long.toBinaryString() method with Examples
- Java cbrt() method with Examples
Advertisements