Method ToInt32
ToInt32()
Converts value of this instance to 32-bit signed integer.
Declaration
public virtual int ToInt32()
Returns
Type | Description |
---|---|
Int32 | Value of this instance as 32-bit signed integer. |
Remarks
This conversion is valid only for numeric instances such as
IntegerValue, LongValue,
DoubleValue, NumberValue or instances
of StringValue containing valid representation of
32-bit signed integer.
Exceptions
Type | Condition |
---|---|
InvalidCastException | If this instance is not numeric and not StringValue. |
OverflowException | In a checked context, if this instance is numeric and represents value less than MinValue or greater than MaxValue |
FormatException | If this instance is StringValue and it does not contain valid representation of integer. |