public enum TRoundingMode extends Enum<TRoundingMode>
Enum Constant and Description |
---|
CEILING
Rounding mode to round towards positive infinity.
|
DOWN
Rounding mode where the values are rounded towards zero.
|
FLOOR
Rounding mode to round towards negative infinity.
|
HALF_DOWN
Rounding mode where values are rounded towards the nearest neighbor.
|
HALF_EVEN
Rounding mode where values are rounded towards the nearest neighbor.
|
HALF_UP
Rounding mode where values are rounded towards the nearest neighbor.
|
UNNECESSARY
Rounding mode where the rounding operations throws an ArithmeticException
for the case that rounding is necessary, i.e. for the case that the value
cannot be represented exactly.
|
UP
Rounding mode where positive values are rounded towards positive infinity
and negative values towards negative infinity.
|
Modifier and Type | Method and Description |
---|---|
static TRoundingMode |
valueOf(int mode)
Converts rounding mode constants from class
BigDecimal into
RoundingMode values. |
static TRoundingMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TRoundingMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TRoundingMode UP
x.round().abs() >= x.abs()
public static final TRoundingMode DOWN
x.round().abs() <= x.abs()
public static final TRoundingMode CEILING
public static final TRoundingMode FLOOR
public static final TRoundingMode HALF_UP
public static final TRoundingMode HALF_DOWN
public static final TRoundingMode HALF_EVEN
public static final TRoundingMode UNNECESSARY
public static TRoundingMode[] values()
for (TRoundingMode c : TRoundingMode.values()) System.out.println(c);
public static TRoundingMode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static TRoundingMode valueOf(int mode)
BigDecimal
into
RoundingMode
values.mode
- rounding mode constant as defined in class BigDecimal
Copyright © 2019. All rights reserved.