C# Decimal Explicit(Decimal to Byte)
Description
Decimal Explicit(Decimal to Byte)
defines an explicit
conversion of a Decimal to an 8-bit unsigned integer.
Syntax
Decimal.Explicit(Decimal to Byte)
has the following syntax.
public static explicit operator byte (
decimal value
)
Parameters
Decimal.Explicit(Decimal to Byte)
has the following parameters.
value
- The value to convert.
Returns
Decimal.Explicit(Decimal to Byte)
method returns An 8-bit unsigned integer that represents the converted Decimal.
Example
The following example converts Decimal numbers to Byte values by using the explicit Decimal to Byte conversion.
using System;/*from ww w .j a v a 2s .c o m*/
class Example
{
public static void Main()
{
Byte byteValue = (Byte) 78.999m;
Console.WriteLine(byteValue);
}
}
The code above generates the following result.