-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Use the most appropriate unit to reduce the number of digits when displaying something #510
Comments
See also: #219 (comment)
Not as general as what you're asking, but you can use
|
Nice. I didn't know about But yes, I guess I want the same thing as #219:
And I believe it should be used by default. Feel free to close the issue if you think it's already sufficiently tracked somewhere else |
I'd prefer this to be opt-in and not default. My reasoning is that I often want to keep calculations in the same units I used for consistency. It could also possibly interfere with functions providing specific generic unit guarantees depending on implementation. I’m especially thinking of the generic unit list functions I have been working on recently. I do find the feature useful though and something like a generic conversion function or keyword to get the best fit would be great. Something like the following would be ideal syntax in my opinion. >>> 10m * 100m -> auto
1km : Length This would also make it easy to extend the API with curried functions to allow some control over what the best fit would be as in the example below. >>> 100m + 1km -> auto_max_decimals(1)
1.1 km : Length
>>> 100m + 1km -> auto_max_decimals(0)
1100 m : Length |
I like the |
Hey,
It would be nice if numbat could find the most appropriate unit to display stuff.
For example, lately, I was trying to compute how long I could run an esp32 on two AA batteries. Depending on the mode used by the esp32, the duration could simply go from a few hours to 10 years.
If numbat had been able to switch between hours, days, months (weeks?), and years, it would have been way easier to read the results and try stuff out
The text was updated successfully, but these errors were encountered: