Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
None
-
None
-
None
Description
When parsing JSON documents with numbers that end in a zero after the decimal point, JsonSlurper is not correctly setting the scale.
For example, when run in groovysh:
groovy:000> (1234.0).scale
===> 1
groovy:000> import groovy.json.JsonSlurper
===> groovy.json.JsonSlurper
groovy:000> new JsonSlurper().parseText('1234.0').scale
===> 0
groovy:000> (1234.10).scale
===> 2
groovy:000> new JsonSlurper().parseText('1234.10').scale
===> 1
This was found in Groovy versions 2.4.3 and 2.4.4.
For a result of this, please refer to https://github.com/DiUS/pact-jvm/issues/221