public static enum Rounder.RoundingPolicy extends Enum<Rounder.RoundingPolicy>
| Enum Constant and Description | 
|---|
| CEILINGBehaves the same as  UPif the value is positive orDOWNif the value is negative. | 
| DOWNDiscards the digits based on decimal places and never increments the digit prior to discarded fraction. | 
| FLOORBehaves the same as  DOWNif the value is positive orUPif the value is negative. | 
| HALF_DOWNIf discarded fraction is > 0.5, then behaves as  UP, otherwise, behaves asDOWN | 
| HALF_EVENIf the digit to the left of the discarded fraction is odd, behaves as  HALF_UP, otherwise, behaves asHALF_DOWN | 
| HALF_ODDIf the digit to the left of the discarded fraction is odd, behaves as  HALF_DOWN, otherwise, behaves asHALF_UP. | 
| HALF_UPIf discarded fraction is ≥ 0.5, then behaves as  UP, otherwise, behaves asDOWN | 
| UNNECESSARYIf value is double, returns the same value. | 
| UPDiscards the digits based on decimal places and always increments the digit prior to discarded fraction. | 
| Modifier and Type | Method and Description | 
|---|---|
| int | getPolicy() | 
| static Rounder.RoundingPolicy | valueOf(String name)Returns the enum constant of this type with the specified name. | 
| static Rounder.RoundingPolicy[] | values()Returns an array containing the constants of this enum type, in
the order they are declared. | 
public static final Rounder.RoundingPolicy UP
public static final Rounder.RoundingPolicy DOWN
public static final Rounder.RoundingPolicy CEILING
UP if the value is positive or DOWN if the value is negative.public static final Rounder.RoundingPolicy FLOOR
DOWN if the value is positive or UP if the value is negative.public static final Rounder.RoundingPolicy HALF_UP
UP, otherwise, behaves as DOWNpublic static final Rounder.RoundingPolicy HALF_DOWN
UP, otherwise, behaves as DOWNpublic static final Rounder.RoundingPolicy HALF_EVEN
HALF_UP, otherwise, behaves as HALF_DOWNpublic static final Rounder.RoundingPolicy HALF_ODD
HALF_DOWN, otherwise, behaves as HALF_UP.
 This RoudingPolicy is only supported for double.  BigDecimal & BigInteger are not supported.public static final Rounder.RoundingPolicy UNNECESSARY
ArithmeticException is thrown.public static Rounder.RoundingPolicy[] values()
for (Rounder.RoundingPolicy c : Rounder.RoundingPolicy.values()) System.out.println(c);
public static Rounder.RoundingPolicy 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 int getPolicy()
Copyright (c) 2006-2025 North Concepts Inc. All Rights Reserved.