public class BigDecimalHelper
extends java.lang.Object
BigDecimals.| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_PRECISION |
static int |
MAX_SCALE |
static int |
MAX_UI_PERCENTAGE_SCALE
All percentages are shown using two separated boxes: one for the integer part and other for the decimal part, but
they are stored as a unique
value in the range [0..1] (divided by 100) then the supported scale for those values is MAX_SCALE - 2
This constant can be used only in the client side by a page showing a PercentageField
|
static java.math.BigDecimal |
ONE_HUNDRED |
| Constructor and Description |
|---|
BigDecimalHelper() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
areEquals(java.math.BigDecimal bd1,
java.math.BigDecimal bd2) |
static int |
compareTo(java.math.BigDecimal bd1,
java.math.BigDecimal bd2) |
static boolean |
isNegative(java.math.BigDecimal number)
Returns whether the given number is a negative, non-zero number, given a precision delta
|
static boolean |
isNegativeOrZero(java.math.BigDecimal number)
Returns whether the given number is a negative or zero number, given a precision delta
|
static boolean |
isPositive(java.math.BigDecimal number)
Returns whether the given number is a positive, non-zero number, given a precision delta
|
static boolean |
isPositiveOrZero(java.math.BigDecimal number)
Returns whether the given number is a positive or zero number, given a precision delta
|
static boolean |
isZero(java.math.BigDecimal number)
Returns whether the given number is a negative, non-zero number, given a precision delta
|
static java.math.BigDecimal |
round(java.math.BigDecimal number,
int scale)
Rounds the given number to the given scale
|
static java.math.BigDecimal |
zeroWhenNull(java.math.BigDecimal bigDecimal)
Returns zero when the given BigDecimal is null
|
public static final java.math.BigDecimal ONE_HUNDRED
public static final int MAX_PRECISION
public static final int MAX_SCALE
public static final int MAX_UI_PERCENTAGE_SCALE
public static boolean areEquals(java.math.BigDecimal bd1,
java.math.BigDecimal bd2)
public static int compareTo(java.math.BigDecimal bd1,
java.math.BigDecimal bd2)
public static boolean isNegative(java.math.BigDecimal number)
public static boolean isNegativeOrZero(java.math.BigDecimal number)
public static boolean isPositive(java.math.BigDecimal number)
public static boolean isPositiveOrZero(java.math.BigDecimal number)
public static boolean isZero(java.math.BigDecimal number)
public static java.math.BigDecimal round(java.math.BigDecimal number,
int scale)
public static java.math.BigDecimal zeroWhenNull(java.math.BigDecimal bigDecimal)