Converts a Decimal to an 8-bit unsigned byte.
[Visual Basic] Overloads Public Shared Function ToByte( _ ByVal value As Decimal _ ) As Byte [C#] public static byte ToByte( Decimal value ); [C++] public: static unsigned char ToByte( Decimal value ); [JScript] public static function ToByte( value : Decimal ) : Byte;
value rounded to the nearest integer. If value is exactly halfway between two whole numbers, this method returns the the integer that is even (i.e. 4.5 is converted to 4, and 5.5 is converted to 6).
Exception Type | Condition |
---|---|
OverflowException | The value is greater than Byte.MaxValue or less than Byte.MinValue. |
Convert Class | Convert Members | System Namespace | Convert.ToByte Overload List