Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse float as double-precision floating-point #334

Merged
merged 3 commits into from
Jul 17, 2018

Conversation

konradreiche
Copy link
Contributor

In the GraphQL specification, the float scalar type is specified as as double-precision number:

The Float scalar type represents signed double‐precision fractional values as specified by IEEE 754. Response formats that support an appropriate double‐precision number type should use that type to represent this scalar.

Hence, it should also be parsed as such, otherwise we get precision errors, i.e. 0.7 becomes 0.699999988079071. This issue has already been raised in #165.

@coveralls
Copy link

coveralls commented Jun 16, 2018

Coverage Status

Coverage remained the same at 80.752% when pulling 2cb5e42 on konradreiche:master into 86f19d5 on graphql-go:master.

@chris-ramon
Copy link
Member

chris-ramon commented Jul 17, 2018

LGTM 👍 — thanks a lot @konradreiche
closes: #165

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants