C# Decimal Explicit(Decimal to SByte)

Description

Decimal Explicit(Decimal to SByte) defines an explicit conversion of a Decimal to an 8-bit signed integer.

Syntax

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


public static explicit operator sbyte (
  decimal value
)

Parameters

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

  • value - The value to convert.

Returns

Decimal.Explicit(Decimal to SByte) method returns An 8-bit signed integer that represents the converted Decimal.

Example

The following example converts Decimal numbers to SByte values by using the explicit Decimal to SByte conversion.


using System;//from w w  w  .j  a  v a 2 s  .  c  o  m

class Example
{
    public static void Main()
    {
       SByte byteValue = (SByte) 78m;
       Console.WriteLine(byteValue);
    }
}

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