Is there any currency value that Jackson will serialize incorrectly?

Is is well known that numbers like 0.1 cannot be represented exactly in floating point. If you try to get a string representation of 0.1 though, you will see exactly "0.1" because Java(and many other languages) will do some implicit rounding for you when converting to a string. What's a bit more surprising is that when serializing 0.1 to a JSON you will still get the exact value even though it is serialized as a number and not a string type. I'm guessing this is because the entire JSON is...

Read More »

By: StackOverFlow - Tuesday, 13 March

Related Posts