| java.lang.Object org.zkoss.math.RoundingModes
RoundingModes | public class RoundingModes (Code) | | Utilities to handle the rounding mode.
author: tomyeh |
Method Summary | |
final public static String | toString(int roundingMode) Returns the name of the rounding mode. | final public static int | valueOf(String name) Returns the rounding mode of the specified name.
Parameters: name - the rounding mode's name. |
toString | final public static String toString(int roundingMode)(Code) | | 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 | final public static int valueOf(String name)(Code) | | 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.
|
|
|