This content has been marked as final. Show 2 replies
user712747 wrote:That sounds very odd.
When we are converting string to BigDecimal, in JAVA 1.5 it is post fixing with extra “0”(zero) if the string value ends with single “ ”0” (zero).
To overcome this we can use toPlainString() method in Java 1.5. But it is not feasible to make this change all over places in our code.Aha! This sounds like conversion from BigDecimal to String; not what you described above. And I have to admit, that change mystified me too, because it goes against the grain of backwards-compatibility. It's possible that it was meant to "standardize" output for floating-point values though.
Is there any fix available?Well, one thing might be to use toPlainString() in the places where you're having problems. The string produced by toString() is still suitable for converting back to BigIntegers (and will do so precisely; I believe the toPlainString() style could produce a BigDecimal with the same value but different scale), so unless you actually need the string for viewing you can leave it alone.
But as EJP says, post some code.