BigDecimal.SetScale Method

Definition

Overloads

SetScale(Int32)

Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to this BigDecimal's.

SetScale(Int32, RoundingMode)

Returns a BigDecimal whose scale is the specified value, and whose unscaled value is determined by multiplying or dividing this BigDecimal's unscaled value by the appropriate power of ten to maintain its overall value.

SetScale(Int32, RoundOptions)

Returns a BigDecimal whose scale is the specified value, and whose unscaled value is determined by multiplying or dividing this BigDecimal's unscaled value by the appropriate power of ten to maintain its overall value.

SetScale(Int32)

Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to this BigDecimal's.

[Android.Runtime.Register("setScale", "(I)Ljava/math/BigDecimal;", "GetSetScale_IHandler")]
public virtual Java.Math.BigDecimal? SetScale (int newScale);
[<Android.Runtime.Register("setScale", "(I)Ljava/math/BigDecimal;", "GetSetScale_IHandler")>]
abstract member SetScale : int -> Java.Math.BigDecimal
override this.SetScale : int -> Java.Math.BigDecimal

Parameters

newScale
Int32

scale of the BigDecimal value to be returned.

Returns

a BigDecimal whose scale is the specified value, and whose unscaled value is determined by multiplying or dividing this BigDecimal's unscaled value by the appropriate power of ten to maintain its overall value.

Attributes

Exceptions

if rounding would be necessary.

Remarks

Java documentation for java.math.BigDecimal.setScale(int).

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

SetScale(Int32, RoundingMode)

Returns a BigDecimal whose scale is the specified value, and whose unscaled value is determined by multiplying or dividing this BigDecimal's unscaled value by the appropriate power of ten to maintain its overall value.

[Android.Runtime.Register("setScale", "(ILjava/math/RoundingMode;)Ljava/math/BigDecimal;", "GetSetScale_ILjava_math_RoundingMode_Handler")]
public virtual Java.Math.BigDecimal? SetScale (int newScale, Java.Math.RoundingMode? roundingMode);
[<Android.Runtime.Register("setScale", "(ILjava/math/RoundingMode;)Ljava/math/BigDecimal;", "GetSetScale_ILjava_math_RoundingMode_Handler")>]
abstract member SetScale : int * Java.Math.RoundingMode -> Java.Math.BigDecimal
override this.SetScale : int * Java.Math.RoundingMode -> Java.Math.BigDecimal

Parameters

newScale
Int32

scale of the BigDecimal value to be returned.

roundingMode
RoundingMode

The rounding mode to apply.

Returns

a BigDecimal whose scale is the specified value, and whose unscaled value is determined by multiplying or dividing this BigDecimal's unscaled value by the appropriate power of ten to maintain its overall value.

Attributes

Exceptions

if roundingMode == null.

if roundingMode == ROUND_UNNECESSARY and rounding is necessary according to the given scale.

Remarks

Java documentation for java.math.BigDecimal.setScale(int, java.math.RoundingMode).

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

SetScale(Int32, RoundOptions)

Returns a BigDecimal whose scale is the specified value, and whose unscaled value is determined by multiplying or dividing this BigDecimal's unscaled value by the appropriate power of ten to maintain its overall value.

[Android.Runtime.Register("setScale", "(II)Ljava/math/BigDecimal;", "GetSetScale_IIHandler")]
public virtual Java.Math.BigDecimal? SetScale (int newScale, Java.Math.RoundOptions roundingMode);
[<Android.Runtime.Register("setScale", "(II)Ljava/math/BigDecimal;", "GetSetScale_IIHandler")>]
abstract member SetScale : int * Java.Math.RoundOptions -> Java.Math.BigDecimal
override this.SetScale : int * Java.Math.RoundOptions -> Java.Math.BigDecimal

Parameters

newScale
Int32

scale of the BigDecimal value to be returned.

roundingMode
RoundOptions

The rounding mode to apply.

Returns

a BigDecimal whose scale is the specified value, and whose unscaled value is determined by multiplying or dividing this BigDecimal's unscaled value by the appropriate power of ten to maintain its overall value.

Attributes

Exceptions

if roundingMode is not a valid rounding mode.

if roundingMode == ROUND_UNNECESSARY and rounding is necessary according to the given scale.

Remarks

Java documentation for java.math.BigDecimal.setScale(int, int).

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