Share via


MathContext.RoundHalfEven Field

Definition

Caution

This constant will be removed in the future version. Use Android.Icu.Math.RoundOptionsUnused enum directly instead of this field.

Rounding mode to round to nearest neighbor, where an equidistant value is rounded to the nearest even neighbor.

[Android.Runtime.Register("ROUND_HALF_EVEN", ApiSince=24)]
[System.Obsolete("This constant will be removed in the future version. Use Android.Icu.Math.RoundOptionsUnused enum directly instead of this field.", true)]
public const Android.Icu.Math.RoundOptionsUnused RoundHalfEven = 6;
[<Android.Runtime.Register("ROUND_HALF_EVEN", ApiSince=24)>]
[<System.Obsolete("This constant will be removed in the future version. Use Android.Icu.Math.RoundOptionsUnused enum directly instead of this field.", true)>]
val mutable RoundHalfEven : Android.Icu.Math.RoundOptionsUnused

Field Value

Value = 6
Attributes

Remarks

Rounding mode to round to nearest neighbor, where an equidistant value is rounded to the nearest even neighbor. Used as a setting to control the rounding mode used during a BigDecimal operation.

If the discarded digits represent greater than half (0.5 times) the value of a one in the next position then the result should be rounded up (away from zero). If they represent less than half, then the result should be rounded down.

Otherwise (they represent exactly half) the result is rounded down if its rightmost digit is even, or rounded up if its rightmost digit is odd (to make an even digit).

Java documentation for android.icu.math.MathContext.ROUND_HALF_EVEN.

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