Java.Math.BigDecimal.SetScale Method
Returns a new BigDecimal instance with the specified scale.

Syntax

[Android.Runtime.Register("setScale", "(I)Ljava/math/BigDecimal;", "GetSetScale_IHandler")]
public virtual BigDecimal SetScale (int newScale)

Parameters

newScale
scale of the result returned.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Lang.ArithmeticExceptionif rounding would be necessary.

Remarks

Returns a new BigDecimal instance with the specified scale. If the new scale is greater than the old scale, then additional zeros are added to the unscaled value. If the new scale is smaller than the old scale, then trailing zeros are removed. If the trailing digits are not zeros then an ArithmeticException is thrown.

If no exception is thrown, then the following equation holds: x.setScale(s).compareTo(x) == 0.

[Android Documentation]

Requirements

Namespace: Java.Math
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1