top of page

BigDecimal is more precise than double


What I learned today. (24 May, 2019)

It is better to use BigDecimal in Monetary Calculation because it is more precise than double. Even $0.000001 different for one transaction can make $1 different if there are 1 million transaction of money.

Sum the double value (0.11) for 100 times with for loop:


Result :


Sum the BigDecimal value ("0.11") for 100 times with for loop:


Result :


Single post: Blog_Single_Post_Widget
bottom of page