NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Decimal.ToInt16 (Decimal)

Converts a Decimal to an Int16 with a specified format.

[Visual Basic]
Overloads Public Shared Function ToInt16( _
   ByVal value As Decimal _
) As Short
[C#]
public static short ToInt16(
   Decimal value
);
[C++]
public: static short ToInt16(
   Decimal value
);
[JScript]
public static function ToInt16(
   value : Decimal
) : Int16;

Parameters

value
The Decimal value to convert.

Return Value

The result's of converting the argument to a short.

Exceptions

Exception Type Condition
OverflowException is thrown if the resulting integer value is less than Int16.MinValue or greater than Int16.MaxValue.

Remarks

The ToInt16 method returns a short. The Decimal value is rounded toward zero to the nearest integer value, and the result of this operation is returned as a short.

This method implements IConvertible, which replaced IValue. This method is used to obtain the type code for a specified object. (See Convert and Value for more information about conversions; see the Type for more information about types.)

See Also

Decimal Structure | Decimal Members | System Namespace | Decimal.ToInt16 Overload List