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

Better unit selection in Debug impl #67

Open
Tehforsch opened this issue Jan 12, 2024 · 0 comments
Open

Better unit selection in Debug impl #67

Tehforsch opened this issue Jan 12, 2024 · 0 comments
Labels
ergonomics Library usage ergonomics

Comments

@Tehforsch
Copy link
Owner

Ever since #44, the old behavior of selecting a nice unit to display the quantity in was disabled since there were just too many units to make sense of the result. (10m would be printed as 1 dam).

There are many solutions to this, but I think a nice one should prevent certain prefixes from ever being printed in (deca, hecto) - if one really wants to go overboard this could be unit specific (hPa is used) and we could add an attribute #[debug_print] over a unit to declare a preferred unit for printing in (#41 ).

The main difficulty in implementing any of this (this applies to #33 ) is that storing the unit information at runtime is very awkward currently. What I'd like to do is define a proper container for the runtime information we have about units that can quickly answer questions such as "what are all the units for a given dimension".

@Tehforsch Tehforsch added the ergonomics Library usage ergonomics label Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ergonomics Library usage ergonomics
Projects
None yet
Development

No branches or pull requests

1 participant