BigDecimal.RoundHalfUp Field

Definition

Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round up.

[Android.Runtime.Register("ROUND_HALF_UP")]
public const Java.Math.RoundOptions RoundHalfUp = 4;
[<Android.Runtime.Register("ROUND_HALF_UP")>]
val mutable RoundHalfUp : Java.Math.RoundOptions

Field Value

Value = 4
Attributes

Remarks

Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round up. Behaves as for ROUND_UP if the discarded fraction is &ge; 0.5; otherwise, behaves as for ROUND_DOWN. Note that this is the rounding mode that most of us were taught in grade school.

This member is deprecated. Use RoundingMode#HALF_UP instead.

Java documentation for java.math.BigDecimal.ROUND_HALF_UP.

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

See also