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

Number parsing failes due to locale format #29

Open
CodeMazeSolver opened this issue Sep 12, 2024 · 1 comment
Open

Number parsing failes due to locale format #29

CodeMazeSolver opened this issue Sep 12, 2024 · 1 comment

Comments

@CodeMazeSolver
Copy link

Hello,
Using the Mago 3D tiler (mago-3d-tiler-1.8.1-natives-windows.jar) to convert CityGML, I noticed that your local format will be applied during the number parsing. This means that the parsing will result in an error in languages like German, which uses a comma (17,5) instead of a period (17.5) to separate decimal numbers.

grafik

I'd suggest always using the default locale "en-US" for numbers.

https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Locale.html#US

Changing your number formatting in the Windows settings to use a language with a point separator for decimals, e.g., American English, solves this issue for now.

Best regards

@znkim
Copy link
Contributor

znkim commented Sep 13, 2024

Hi, @CodeMazeSolver

First of all, thanks for the advice.

I checked and java.text.DecimalFormat was using the system locale.
As you said, I've made sure to apply the Locale.ENGLISH when formatting the decimal point.

This will be applied in the next release.
Thanks a lot.

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

2 participants