Share via


BigDecimal.ShortValueExact Method

Definition

Converts this BigDecimal to a short, checking for lost information.

[Android.Runtime.Register("shortValueExact", "()S", "GetShortValueExactHandler")]
public virtual short ShortValueExact ();
[<Android.Runtime.Register("shortValueExact", "()S", "GetShortValueExactHandler")>]
abstract member ShortValueExact : unit -> int16
override this.ShortValueExact : unit -> int16

Returns

this BigDecimal converted to a short.

Attributes

Exceptions

if rounding is necessary of the number doesn't fit in a short.

Remarks

Converts this BigDecimal to a short, checking for lost information. If this BigDecimal has a nonzero fractional part or is out of the possible range for a short result then an ArithmeticException is thrown.

Added in 1.5.

Java documentation for java.math.BigDecimal.shortValueExact().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to