Convert.ToSByte Method (Decimal)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Converts the value of the specified Decimal number to an equivalent 8-bit signed integer.

This API is not CLS-compliant. 

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

Syntax

<CLSCompliantAttribute(False)> _
Public Shared Function ToSByte ( _
    value As Decimal _
) As SByte
[CLSCompliantAttribute(false)]
public static sbyte ToSByte(
    decimal value
)

Parameters

Return Value

Type: System..::.SByte
value rounded to the nearest 8-bit signed integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

Exceptions

Exception Condition
OverflowException

value is greater than SByte..::.MaxValue or less than SByte..::.MinValue.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Platforms

Windows Phone

See Also

Reference

Convert Class

ToSByte Overload

System Namespace

Math..::.Round