Language

RoundOptionsUnused Enum

Definition

public enum RoundOptionsUnused
type RoundOptionsUnused = 
Inheritance
RoundOptionsUnused

Fields

Name Value Description
Up 0

Rounding mode to round away from zero. Used as a setting to control the rounding mode used during a BigDecimal operation.

If any of the discarded digits are non-zero then the result will be rounded up (away from zero).

Android reference for android.icu.math.MathContext.ROUND_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.

Down 1

Rounding mode to round towards zero. Used as a setting to control the rounding mode used during a BigDecimal operation.

All discarded digits are ignored (truncated). The result is neither incremented nor decremented.

Android reference for android.icu.math.MathContext.ROUND_DOWN.

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.

Ceiling 2

Rounding mode to round to a more positive number. Used as a setting to control the rounding mode used during a BigDecimal operation.

If any of the discarded digits are non-zero then the result should be rounded towards the next more positive digit.

Android reference for android.icu.math.MathContext.ROUND_CEILING.

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.

Floor 3

Rounding mode to round to a more negative number. Used as a setting to control the rounding mode used during a BigDecimal operation.

If any of the discarded digits are non-zero then the result should be rounded towards the next more negative digit.

Android reference for android.icu.math.MathContext.ROUND_FLOOR.

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.

HalfUp 4

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

If the discarded digits represent greater than or equal to half (0.5 times) the value of a one in the next position then the result should be rounded up (away from zero). Otherwise the discarded digits are ignored.

Android reference for android.icu.math.MathContext.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.

HalfDown 5

Rounding mode to round to nearest neighbor, where an equidistant value is rounded down. 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). Otherwise the discarded digits are ignored.

Android reference for android.icu.math.MathContext.ROUND_HALF_DOWN.

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.

HalfEven 6

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).

Android reference 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.

Unnecessary 7

Rounding mode to assert that no rounding is necessary. Used as a setting to control the rounding mode used during a BigDecimal operation.

Rounding (potential loss of information) is not permitted. If any of the discarded digits are non-zero then an ArithmeticException should be thrown.

Android reference for android.icu.math.MathContext.ROUND_UNNECESSARY.

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.

Remarks

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