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

Different precisions to output of spatial data types #52

Open
3 tasks
schroedtert opened this issue Mar 4, 2021 · 0 comments
Open
3 tasks

Different precisions to output of spatial data types #52

schroedtert opened this issue Mar 4, 2021 · 0 comments

Comments

@schroedtert
Copy link
Member

libfmt offers the possibility to pass the desired precision of the output to the formatter for the spatial data types.
https://fmt.dev/latest/api.html#formatting-user-defined-types

This would enable to a better controllable output, example:

fmt::format("{:.4f}", Coordiante{0.1, 0.1, Level{1}}); // "COORDINATE(0.1000, 0.1000) -- LEVEL 1"
fmt::format("{:.1f}", Coordiante{0.1, 0.1, Level{1}}); // "COORDINATE(0.1, 0.1) -- LEVEL 1"

ToDo:

  • add formatting option to formatter
  • add unit tests on cpp side
  • change the precision for __str__ and __repr__ in the pybinds
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