Java Utililty Methods BigDecimal

List of utility methods to do BigDecimal

Description

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

Method

BigDecimalvalueOf(final BigDecimal value)
value Of
return value;
voidwriteBigDecimal(BigDecimal val, DataOutput out)
Writes BigDecimal value.
if (val.compareTo(BigDecimal.ZERO) == 0) {
    out.writeByte(DECIMAL_ZERO);
} else if (val.compareTo(BigDecimal.ONE) == 0) {
    out.writeByte(DECIMAL_ONE);
} else if (val.compareTo(BigDecimal.TEN) == 0) {
    out.writeByte(DECIMAL_TEN);
} else {
    int scale = val.scale();
...
voidwriteBigDecimal(final OutputStream out, @Nullable final BigDecimal value)
write Big Decimal
if (!writeNullMark(out, value)) {
    if (value.signum() == 0) { 
        writeVarInt(out, 0);
    } else {
        final BigInteger unscaledValue = value.unscaledValue();
        final byte[] bits = unscaledValue.toByteArray();
        writeVarInt(out, bits.length);
        out.write(bits, 0, bits.length);
...
booleanzeroOrMore(BigDecimal decimal)
Kijkt of een decimal een waarde heeft die op of boven 0.0 ligt.
return decimal != null && decimal.compareTo(BigDecimal.ZERO) >= 0;