The constructor of BigDecimal (double) has some problems, it is preferable to use BigDecimal (String) or BigDecimal.valueOf (double).
System.out.println(new BigDecimal(135.69));
System.out.println(new BigDecimal("135.69"));
System.out.println(BigDecimal.valueOf(135.69));
The BigDecimal (double) documentation explains this behavior:
- . , BigDecimal (0.1) Java BigDecimal, 0,1 ( 1 1), 0,1000000000000000055511151231257827021181583404541015625. , 0,1 (, , ). , , , 0,1, , .
- String, , : BigDecimal ( "0.1" ) BigDecimal, 0,1, . , , String .
- BigDecimal double, , ; , double String Double.toString(double), BigDecimal (String). , valueOf (double).