The BigDecimal
is immutable so you need to do this:
BigDecimal result = test.add(new BigDecimal(30));
System.out.println(result);
More Related Contents:
- Double vs. BigDecimal?
- How to change the decimal separator of DecimalFormat from comma to dot/point?
- Using BigDecimal to work with currencies
- Logarithm of a BigDecimal
- How to set thousands separator in Java?
- How to print formatted BigDecimal values?
- Safe String to BigDecimal conversion
- Square root of BigDecimal in Java
- BigDecimal equals() versus compareTo()
- Java:Why should we use BigDecimal instead of Double in the real world? [duplicate]
- Adding up BigDecimals using Streams
- Rounding BigDecimal to *always* have two decimal places
- Convert seconds value to hours minutes seconds?
- Convert double to BigDecimal and set BigDecimal Precision
- How to do a fractional power on BigDecimal in Java?
- Java BigDecimal: Round to the nearest whole value
- BigDecimal – to use new or valueOf
- Set specific precision of a BigDecimal
- Java BigDecimal trigonometric methods
- BigDecimal setScale and round
- Removing trailing zeros from BigDecimal in Java
- BigDecimal adding wrong value
- How can I parse a String to BigDecimal? [duplicate]
- Java BigDecimal memory usage?
- BigDecimal summary statistics
- BigDecimal from Double incorrect value?
- How to use comparison operators like >, =, < on BigDecimal
- Using Struts2 Tags to Formatting Numbers
- Why is BigDecimal.equals specified to compare both value and scale individually?
- Why does new BigDecimal(“0.0”).stripTrailingZeros() have a scale of 1?