C# Decimal Implicit(Char to Decimal)

Description

Decimal Implicit(Char to Decimal) defines an explicit conversion of a Unicode character to a Decimal.

Syntax

Decimal.Implicit(Char to Decimal) has the following syntax.


public static implicit operator decimal (
  char value
)

Parameters

Decimal.Implicit(Char to Decimal) has the following parameters.

  • value - The Unicode character to convert.

Returns

Decimal.Implicit(Char to Decimal) method returns The converted Unicode character.

Example

The following example converts Char values (Unicode characters) to Decimal numbers.


using System;/*from www  .j  a  v  a 2  s.  c om*/

class Example
{
    public static void Main()
    {
        // Convert each Char value to a Decimal. 
        decimal decValue = 123;
        Console.WriteLine(decValue);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version