Java Utililty Methods BigDecimal from

List of utility methods to do BigDecimal from

Description

The list of methods to do BigDecimal from are organized into topic(s).

Method

BigDecimalnumberToBigDecimal(Number number)
Converts the given number to a BigDecimal.
return number == null ? null : new BigDecimal(number.toString());
BigDecimalnumberToBigDecimal(Number value)
number To Big Decimal
if (isAFloatingPointNumber(value)) {
    return new BigDecimal(value.doubleValue());
} else {
    return new BigDecimal(value.longValue());
BigDecimalnumberToBigDecimal(Object number)
number To Big Decimal
if (number == null) {
    return null;
if (!(number instanceof Number)) {
    throw new IllegalArgumentException("Input object is not a number");
return new BigDecimal(((Number) number).toString());
BigDecimalnumberToBigDecimal(Object obj)
number To Big Decimal
return obj instanceof Number ? newBigDecimal(obj) : null;
BigDecimaltoBigDecimal(byte[] bytes)
Converts a byte array to a BigDecimal
return toBigDecimal(bytes, 0, bytes.length);
BigDecimaltoBigDecimal(Double d)
Converts a Double to a BigDecimal.
if (d == null) {
    return null;
return BigDecimal.valueOf(d);
BigDecimaltoBigDecimal(Double d)
convert to bigdecimal.
BigDecimal bd = null;
if (null != d) {
    bd = new BigDecimal(d);
return bd;
BigDecimaltoBigDecimal(double val)
to Big Decimal
assert !Double.isNaN(val);
assert !Double.isInfinite(val);
return new BigDecimal(Double.toString(val));
BigDecimal[][]toBigDecimal(double[][] a)
to Big Decimal
int n = a.length;
BigDecimal[][] b = new BigDecimal[n][n];
for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
        b[i][j] = BigDecimal.valueOf(a[i][j]);
return b;
...
BigDecimaltoBigDecimal(final byte value)
to Big Decimal
return BigDecimal.valueOf(value);