Converts a Double to a UInt16.
[Visual Basic] Overloads Public Shared Function ToUInt16( _ ByVal value As Double _ ) As UInt16 [C#] public static ushort ToUInt16( double value ); [C++] public: static unsigned short ToUInt16( double value ); [JScript] public static function ToUInt16( value : double ) : UInt16;
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 | is thrown if value is greater than UInt16.MaxValue or less than UInt16.MinValue. |
Convert Class | Convert Members | System Namespace | Convert.ToUInt16 Overload List