Title: Double parsed with trailing zeros · Issue #206 · json-iterator/java · GitHub
Open Graph Title: Double parsed with trailing zeros · Issue #206 · json-iterator/java
X Title: Double parsed with trailing zeros · Issue #206 · json-iterator/java
Description: Some double values trigger trailing zeros when deserialized. "field": 1.2932 (of type Double) Is parsed as 1.2932000000000001 If you change the field to type Float then the value is correctly parsed. Again only certain numbers appear to ...
Open Graph Description: Some double values trigger trailing zeros when deserialized. "field": 1.2932 (of type Double) Is parsed as 1.2932000000000001 If you change the field to type Float then the value is correctly parse...
X Description: Some double values trigger trailing zeros when deserialized. "field": 1.2932 (of type Double) Is parsed as 1.2932000000000001 If you change the field to type Float then the value is corre...
Opengraph URL: https://github.com/json-iterator/java/issues/206
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Double parsed with trailing zeros","articleBody":"Some double values trigger trailing zeros when deserialized.\r\n\r\n```\r\n\"field\": 1.2932 (of type Double)\r\n```\r\n\r\nIs parsed as 1.2932000000000001\r\n\r\nIf you change the field to type Float then the value is correctly parsed.\r\n\r\nAgain only certain numbers appear to be triggering this.\r\n\r\nYou can replicate the issue like this.\r\n\r\nDefine:\r\n\r\n```\r\nclass Obj {\r\n\r\n Double field;\r\n\r\n}\r\n```\r\n\r\nThen execute: \r\n\r\n```\r\nString json = \"{ \\\"field\\\" : 1.2932}\";\r\nObj obj = JsonIterator.deserialize(json,Obj.class);\r\nSystem.out.println(obj.getField());\r\n// 1.2932000000000001\r\n```\r\n\r\nSame issue arises even if you use the `Any` api.","author":{"url":"https://github.com/robbienohra","@type":"Person","name":"robbienohra"},"datePublished":"2018-09-04T15:08:52.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/206/java/issues/206"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cf2555f6-27b8-fa32-8885-1c6c68396b06 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C974:9CC2A:4E3E20:6DD4C0:696A6C2B |
| html-safe-nonce | 10767238efd8c4f4694347e02f9ce7ecf453e89987f942365164d09b1c46b50c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTc0OjlDQzJBOjRFM0UyMDo2REQ0QzA6Njk2QTZDMkIiLCJ2aXNpdG9yX2lkIjoiMTY5OTAzMTYxODg3ODU5ODE4NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ab93147b300c489297b7d126bdd24a62b1837271f51a530467564c0ddeacdbaf |
| hovercard-subject-tag | issue:356854943 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/json-iterator/java/206/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3dcf738988a6fb52ceef41b2b97caced878f400d9923df796b3b6ecee44d430f/json-iterator/java/issues/206 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3dcf738988a6fb52ceef41b2b97caced878f400d9923df796b3b6ecee44d430f/json-iterator/java/issues/206 |
| og:image:alt | Some double values trigger trailing zeros when deserialized. "field": 1.2932 (of type Double) Is parsed as 1.2932000000000001 If you change the field to type Float then the value is correctly parse... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | robbienohra |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6fea32d5b7276b841b7a803796d9715bc6cfb31ed549fdf9de2948ac25d12ba6 |
| turbo-cache-control | no-preview |
| go-import | github.com/json-iterator/java git https://github.com/json-iterator/java.git |
| octolytics-dimension-user_id | 24260074 |
| octolytics-dimension-user_login | json-iterator |
| octolytics-dimension-repository_id | 75621695 |
| octolytics-dimension-repository_nwo | json-iterator/java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 75621695 |
| octolytics-dimension-repository_network_root_nwo | json-iterator/java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f2d9f6432a5a115ec709295ae70623f33bb80aee |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width