I have this result of division:
4893.305785123966785163027491292661448576748
I want to round to 4893.30, but it always returns 4893.31. but when the second decimal will be 6 or more i want to round up.
new BigDecimal("4893.305785123966785163027491292661448576748").setScale(2,BigDecimal.ROUND_HALF_DOWN)); to 4893.31 //BAD
new BigDecimal("4893.305").setScale(2,BigDecimal.ROUND_HALF_DOWN)); to 4893.30 //OK
new BigDecimal("4893.3055").setScale(2,BigDecimal.ROUND_HALF_DOWN)); to 4893.31 //BAD
How does the round work? I want to take in consideration only the value of the second decimal. Any ideas?