You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Ronald Holshausen (JIRA)" <ji...@apache.org> on 2016/03/18 05:41:33 UTC

[jira] [Resolved] (GROOVY-7794) JsonSlurper is dropping precision of decimal numbers ending in 0 after the decimal point

     [ https://issues.apache.org/jira/browse/GROOVY-7794?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ronald Holshausen resolved GROOVY-7794.
---------------------------------------
    Resolution: Duplicate

Duplicate of GROOVY-6922 fixed in 2.4.6

> JsonSlurper is dropping precision of decimal numbers ending in 0 after the decimal point
> ----------------------------------------------------------------------------------------
>
>                 Key: GROOVY-7794
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7794
>             Project: Groovy
>          Issue Type: Bug
>          Components: JSON
>            Reporter: Ronald Holshausen
>
> 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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)