You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where all the values are now 1 and not 10000000000000000.
I know this example is ridiculous but the affected function make_str() is used often and such a problem might occur in other places.
Looking at utils.py:77 one can trace the origin:
This bug lead to a wrong value in the produced gpx file if the a
float variable exceeds is at least 10^16 large and is dividable
at least once by 10. The trailing 0's would be removed.
I found a bug in the file gpxpy.utils in the function
make_str()
.Look at the following code:
This produces the following output in
bug.gpx
:Where all the values are now 1 and not 10000000000000000.
I know this example is ridiculous but the affected function
make_str()
is used often and such a problem might occur in other places.Looking at utils.py:77 one can trace the origin:
The strip function matches any of the given characters and thus removes the 0's before the decimal point.
One solution would be to use the proposition mentioned here which only can remove zeros after the decimal point.
I know it might not seem super important but I think this should be fixed nevertheless.
The text was updated successfully, but these errors were encountered: