Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Handle parsing for localised value formats#163

Merged
jenetics merged 1 commit intojenetics:releases/r3.0.1from
raynigon:master
Apr 11, 2022
Merged

Handle parsing for localised value formats#163
jenetics merged 1 commit intojenetics:releases/r3.0.1from
raynigon:master

Conversation

@raynigon
Copy link
Contributor

@raynigon raynigon commented Apr 8, 2022

Description

When serializing a GPX file, the decimal values are formatted with english locale.
This leads to problems when deserializing the data.
The length cannot be parsed if the value exceeds 1000.0

Fixes #162

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Unit Test which creates a GPX object, serializes it and deserializes it

@raynigon
Copy link
Contributor Author

raynigon commented Apr 8, 2022

@jenetics I think this is only a Quick Fix.
But i do not know, how you would like this to be implemented correctly.
Please let me know if and how this should be adapted.

Until then, i added JitPack support which will be removed for the PR with the correct solution.

@jenetics jenetics changed the base branch from master to releases/r3.0.1 April 10, 2022 10:19
Copy link
Owner

@jenetics jenetics left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also fix the root cause and disable the number grouping in the GPX.Writer. Line 1491 - 1493.

final var format = NumberFormat.getNumberInstance(ENGLISH);
format.setMaximumFractionDigits(_maximumFractionDigits);
format.setGroupingUsed(false);

@jenetics
Copy link
Owner

And thank you for the fix 👍

@raynigon raynigon requested a review from jenetics April 11, 2022 07:16
@jenetics jenetics merged commit ca22d82 into jenetics:releases/r3.0.1 Apr 11, 2022
@jenetics jenetics added this to the v3.0.1 milestone Apr 11, 2022
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.

Elevation serialization for values > 1000m is incompatible with deserialization

2 participants

Comments