List of utility methods to do BigDecimal from
BigDecimal[] | toBigDecimalArray(int[] ints) to Big Decimal Array BigDecimal[] result = new BigDecimal[ints.length]; for (int i = 0; i < ints.length; i++) { result[i] = new BigDecimal(ints[i]); return result; |
List | toBigDecimalList(double... list) Returns a list of BigDecimal based on a list of doubles. List<BigDecimal> result = new ArrayList<BigDecimal>(list.length); for (int i = 0; i < list.length; i++) { result.add(BigDecimal.valueOf(list[i])); return result; |
List | toBigDecimalList(List Converts a list of integers to a list of BigDecimals. List<BigDecimal> bigDecimalList = new ArrayList<BigDecimal>(); for (Integer val : list) { bigDecimalList.add(new BigDecimal(val)); return bigDecimalList; |
BigInteger | toBigInteger(@Nullable final BigDecimal value) to Big Integer return (value == null ? null : value.toBigInteger());
|
String | toBigIntString(final BigDecimal bigD) to Big Int String return bigD.setScale(0, RoundingMode.HALF_UP).toBigInteger().toString();
|