Decimal Explicit Conversion (Decimal to SByte)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

clsCompliantAlternativeM:System.Decimal.ToInt16(System.Decimal)equivalentCodeEntityM:System.Decimal.ToSByte(System.Decimal)

Defines an explicit conversion of a Decimal to an 8-bit signed integer.

This API is not CLS-compliant.

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

F# does not support this operator

Parameters

value
Type: System.Decimal

The value to convert.

Return Value

Type: System.SByte

An 8-bit signed integer that represents the converted Decimal.

Exception Condition
OverflowException

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

This operator supports the explicit conversion of a Decimal to a SByte. The syntax for such explicit conversions is language-dependent, and individual language compilers can provide different implementations and return different results. The example illustrates the different return values when you explicitly convert a Decimal value to a Byte and an SByte value by using C# and Visual Basic. To perform a conversion that is independent of language, you can call the ToSByte method or the Convert.ToSByte(Decimal) method.

The following example converts Decimal numbers to SByte values by using the explicit Decimal to SByte conversion.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: