Package org.zkoss.math
Class RoundingModes
java.lang.Object
org.zkoss.math.RoundingModes
Utilities to handle the rounding mode.
- Author:
- tomyeh
-
Method Summary
-
Method Details
-
toString
Returns the name of the rounding mode. Possible values include- CEILING
- Rounding mode to round towards positive infinity.
- DOWN
- Rounding mode to round towards zero.
- FLOOR
- Rounding mode to round towards negative infinity.
- HALF_DOWN
- Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round down.
- HALF_EVEN
- Rounding mode to round towards the "nearest neighbor" unless both neighbors are equidistant, in which case, round towards the even neighbor.
- HALF_UP
- Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round up.
- UNNECESSARY
- Rounding mode to assert that the requested operation has an exact result, hence no rounding is necessary.
- UP
- Rounding mode to round away from zero.
-
valueOf
Returns the rounding mode of the specified name.- Parameters:
name- the rounding mode's name. Allowed values include:- CEILING
- Rounding mode to round towards positive infinity.
- DOWN
- Rounding mode to round towards zero.
- FLOOR
- Rounding mode to round towards negative infinity.
- HALF_DOWN
- Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round down.
- HALF_EVEN
- Rounding mode to round towards the "nearest neighbor" unless both neighbors are equidistant, in which case, round towards the even neighbor.
- HALF_UP
- Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round up.
- UNNECESSARY
- Rounding mode to assert that the requested operation has an exact result, hence no rounding is necessary.
- UP
- Rounding mode to round away from zero.
-