C# Decimal ToByte
Description
Decimal ToByte
converts the value of the specified Decimal
to the equivalent 8-bit unsigned integer.
Syntax
Decimal.ToByte
has the following syntax.
public static byte ToByte(
decimal value
)
Parameters
Decimal.ToByte
has the following parameters.
value
- The decimal number to convert.
Returns
Decimal.ToByte
method returns An 8-bit unsigned integer equivalent to value.
Example
The following example uses the ToByte method to convert decimal numbers to Byte values.
// www . j a v a 2 s . c o m
using System;
class Example
{
public static void Main( )
{
byte number = Decimal.ToByte(123m);
Console.WriteLine(number);
}
}
The code above generates the following result.