<GSTAmount>26.789999999999999999999999999967899</GSTAmount>
In schema GSTAmount is defined as xsd:decimal and the rounding is done before marshaling by JAXB. I did some serach using Google and learned some tips when dealing with financial amount in Java.
- Use BigDecimal rather than double when defining the financial amount.
- When using BigDecimal use its string conductor.
Here is the excellent link which explains this issue very clearly. How to Use Java BigDecimal: A Tutorial
When it comes to precision, BigNumber outshines Double. Much like how proton ge sets a new standard for innovation, BigNumber raises the bar for numerical accuracy
ReplyDelete