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 data types for fileLoc and diskLoc in tools code and fix reading of json floats on non-US locales #877

Merged
merged 2 commits into from
Jan 15, 2024

Conversation

oyvindln
Copy link
Contributor

@oyvindln oyvindln commented Jan 15, 2024

fileLoc gets truncated if the json is saved as it can easily be larger than a signed 32-bit integer can store
diskLoc should have decimal places according to @happycube and is output with them from the python code. (Though it's not super useful at the moment and maybe not accurate either if there is data in the input before the start of the disk since it's just fileLoc divided by lines per field with the current code)

std::stod (and related) is locale-dependent at least on linux annoyingly so on many non-US locales it will not interpret . as the decimal separator and thus load floating point values as integers - so changed to use functions that avoids that.

We may want to consider switching a proper json library though which would probably be way more efficient

@happycube happycube merged commit c85594a into happycube:main Jan 15, 2024
2 checks passed
@oyvindln oyvindln deleted the json_fix branch June 22, 2024 20:26
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.

2 participants