SyntaxFix
Write A Post
Hire A Developer
Questions
Instead of using doubles for decimal arithemetic, please use java.math.BigDecimal. It would produce the expected results.
For reference take a look at this stackoverflow question