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

Fix float precision display #468

Merged
merged 3 commits into from
Apr 17, 2024
Merged

Conversation

ljcui
Copy link
Collaborator

@ljcui ljcui commented Apr 12, 2024

No description provided.

@ljcui ljcui linked an issue Apr 12, 2024 that may be closed by this pull request
@ljcui
Copy link
Collaborator Author

ljcui commented Apr 12, 2024

本质是nlohmann::json 对float类型数字的显示问题。
nlohmann::json存储float会内部转成double,序列化后输出的是double类型的精度。
解决办法:float转成double后进行精度限制,然后再传给nlohmann::json。

@ljcui ljcui requested a review from lipanpan03 April 17, 2024 08:07
@lipanpan03 lipanpan03 enabled auto-merge (squash) April 17, 2024 08:20
@lipanpan03 lipanpan03 merged commit 07bb2bd into TuGraph-family:master Apr 17, 2024
5 checks passed
@ljcui ljcui deleted the fix_float branch April 26, 2024 06:47
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.

存储FLOAT类型,小数位数会扩展
3 participants