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

Logging double values uses loses precision #25

Closed
anjohnson opened this issue Mar 2, 2024 · 1 comment
Closed

Logging double values uses loses precision #25

anjohnson opened this issue Mar 2, 2024 · 1 comment

Comments

@anjohnson
Copy link
Member

The code here for logging float and double values to JSON uses a "%g" conversion, which is insufficient for some of my users. The yajl_gen implementation in EPICS 7 uses "%.17g" and appends ".0" if the previous string only contains digits and/or a minus sign. I will be developing a PR shortly to use that approach instead (or possibly just call yajl_gen to do it).

@anjohnson
Copy link
Member Author

Duplicate of #29, the newer issue better describes my preferred solution.

anjohnson added a commit to anjohnson/caPutLog that referenced this issue Jul 17, 2024
Also adds ".0" to distinguish floats from integers.
Fixes epics-modules#29 (and epics-modules#25)
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

No branches or pull requests

1 participant