BigDecimal division exception
•
Java
When two BigDecimal numbers are used for division, the following exception message appears:
solve:
The generated exception cannot be divided. The solution is to set the accuracy. An example is as follows
. divide(xxxxx,2,BigDecimal.ROUND_HALF_UP);
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码