public class NumberUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
private static BigInteger[] |
BIG_INT_MAX_UNSCALED |
private static BigInteger[] |
BIG_INT_MIN_UNSCALED |
private static BigInteger[] |
BIG_INT_TEN_POW |
private static DecimalFormat |
DOUBLE_FORMATTER |
private static DecimalFormat |
FLOAT_FORMATTER |
| Modifier | Constructor and Description |
|---|---|
private |
NumberUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Double |
add(Double a,
Double b) |
static DecimalFormat |
decimalFormat(String pattern)
Creates a format.
|
static Double |
divide(Double a,
Double b) |
static NumberFormat |
getApproxFormatter(boolean isFloat) |
static BigInteger |
getMaxUnscaled(int precision) |
static BigInteger |
getMinUnscaled(int precision) |
static boolean |
isValidDecimal(BigDecimal bd) |
static Double |
min(Double a,
Double b)
Like
Math.min(int, int) but null safe. |
static Double |
multiply(Double a,
Double b) |
static BigInteger |
powTen(int exponent) |
static BigDecimal |
rescaleBigDecimal(BigDecimal bd,
int scale) |
static long |
round(double d) |
static BigDecimal |
toBigDecimal(Number number) |
static BigDecimal |
toBigDecimal(Number number,
int scale) |
private static final DecimalFormat FLOAT_FORMATTER
private static final DecimalFormat DOUBLE_FORMATTER
private static final BigInteger[] BIG_INT_TEN_POW
private static final BigInteger[] BIG_INT_MIN_UNSCALED
private static final BigInteger[] BIG_INT_MAX_UNSCALED
public static DecimalFormat decimalFormat(String pattern)
public static BigInteger powTen(int exponent)
public static BigInteger getMaxUnscaled(int precision)
public static BigInteger getMinUnscaled(int precision)
public static BigDecimal rescaleBigDecimal(BigDecimal bd, int scale)
public static BigDecimal toBigDecimal(Number number, int scale)
public static BigDecimal toBigDecimal(Number number)
public static boolean isValidDecimal(BigDecimal bd)
public static NumberFormat getApproxFormatter(boolean isFloat)
public static long round(double d)
public static Double min(Double a, Double b)
Math.min(int, int) but null safe.Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.