org.apache.commons.math3.dfp

## Enum DfpField.RoundingMode

- java.lang.Object
- - java.lang.Enum<DfpField.RoundingMode>
  - - org.apache.commons.math3.dfp.DfpField.RoundingMode

All Implemented Interfaces:
  java.io.Serializable, java.lang.Comparable<DfpField.RoundingMode>

Enclosing class:
  DfpField

    public static enum DfpField.RoundingMode
    extends java.lang.Enum<DfpField.RoundingMode>

Enumerate for rounding modes.

### Enum Constant Summary

Enum Constants
Enum Constant and Description
`ROUND_CEIL` Rounds towards positive infinity.
`ROUND_DOWN` Rounds toward zero (truncation).
`ROUND_FLOOR` Rounds towards negative infinity.
`ROUND_HALF_DOWN` Rounds towards nearest unless both are equidistant in which case it rounds toward zero.
`ROUND_HALF_EVEN` Rounds towards nearest unless both are equidistant in which case it rounds toward the even neighbor.
`ROUND_HALF_ODD` Rounds towards nearest unless both are equidistant in which case it rounds toward the odd neighbor.
`ROUND_HALF_UP` Rounds towards nearest unless both are equidistant in which case it rounds away from zero.
`ROUND_UP` Rounds away from zero if discarded digit is non-zero.

### Method Summary

Methods
`static DfpField.RoundingMode` `valueOf(java.lang.String name)` Returns the enum constant of this type with the specified name.
`static DfpField.RoundingMode[]` `values()` Returns an array containing the constants of this enum type, in the order they are declared.

### Methods inherited from class java.lang.Enum

`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

### Enum Constant Detail

#### ROUND_DOWN

    public static final DfpField.RoundingMode ROUND_DOWN

Rounds toward zero (truncation).

#### ROUND_UP

    public static final DfpField.RoundingMode ROUND_UP

Rounds away from zero if discarded digit is non-zero.

#### ROUND_HALF_UP

    public static final DfpField.RoundingMode ROUND_HALF_UP

Rounds towards nearest unless both are equidistant in which case it rounds away from zero.

#### ROUND_HALF_DOWN

    public static final DfpField.RoundingMode ROUND_HALF_DOWN

Rounds towards nearest unless both are equidistant in which case it rounds toward zero.

#### ROUND_HALF_EVEN

    public static final DfpField.RoundingMode ROUND_HALF_EVEN

Rounds towards nearest unless both are equidistant in which case it rounds toward the even neighbor. This is the default as specified by IEEE 854-1987

#### ROUND_HALF_ODD

    public static final DfpField.RoundingMode ROUND_HALF_ODD

Rounds towards nearest unless both are equidistant in which case it rounds toward the odd neighbor.

#### ROUND_CEIL

    public static final DfpField.RoundingMode ROUND_CEIL

Rounds towards positive infinity.

#### ROUND_FLOOR

    public static final DfpField.RoundingMode ROUND_FLOOR

Rounds towards negative infinity.

### Method Detail

#### values

    public static DfpField.RoundingMode[] values()

Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

    for (DfpField.RoundingMode c : DfpField.RoundingMode.values())
        System.out.println(c);

Returns:
  an array containing the constants of this enum type, in the order they are declared

#### valueOf

    public static DfpField.RoundingMode valueOf(java.lang.String name)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
  `name` - the name of the enum constant to be returned.
Returns:
  the enum constant with the specified name
Throws:
  `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
  `java.lang.NullPointerException` - if the argument is null