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

Decimal numbers will become truncated on json parsing when OS system locale is not US-English #395

Open
milosh-dev opened this issue Jun 23, 2022 · 0 comments

Comments

@milosh-dev
Copy link

milosh-dev commented Jun 23, 2022

I have Ubuntu 20.04 OS and my system locale is set to et_EE.UTF-8 (which means that in my system thousands are separated by space and decimals by ",").

When I use jsonlite::fromJSON(text) in R for parsing json, all numbers with decimals (77.87, 23.45, etc.) will become integers (77, 23, etc.). The problem is probably trackable down to R_parse function.

When I set my system locale to US-English the jsonlite::fromJSON parses json fine. The problem exists with my particular locale (Estonian).

For all the remaining programs, and my other R code I have had no problems with my system locale. Also, parsing my json with alternative R packages (like jsonify::from_json) works fine, so the issue exists only with jsonlite.

Unfortunately, I depend on jsonlite functionality, so substituting with jsonify library is not not an option. Any help is needed.

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