C# Decimal Explicit(Decimal to Char)

Description

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

Syntax

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


public static explicit operator char (
  decimal value
)

Parameters

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

  • value - The value to convert.

Returns

Decimal.Explicit(Decimal to Char) method returns A Unicode character that represents the converted Decimal.

Example

The following example converts Decimal numbers to Char values (Unicode characters) by using the explicit Decimal to Char conversion.


/*  w w  w .j av  a2s  . co  m*/
using System;

class Example
{
   public static void Main( )
   {

      char charValue = (char) 77.7m;
      Console.WriteLine(charValue); 
   }
}

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