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

Syntax

[Android.Runtime.Register("setScale", "(ILjava/math/RoundingMode;)Ljava/math/BigDecimal;", "GetSetScale_ILjava_math_RoundingMode_Handler")]
public virtual BigDecimal SetScale (int newScale, RoundingMode roundingMode)

Parameters

newScale
scale of the result returned.
roundingMode
rounding mode to be used to round the result.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Lang.NullPointerExceptionif roundingMode == null.
Java.Lang.ArithmeticExceptionif roundingMode == ROUND_UNNECESSARY and rounding is necessary according to the given scale.

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. In this case no rounding is necessary.

If the new scale is smaller than the old scale, then trailing digits are removed. If these trailing digits are not zero, then the remaining unscaled value has to be rounded. For this rounding operation the specified rounding mode is used.

[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