-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Support mixed units #364
Comments
Qalculate calls this feature "mixed units". You can convert heights to "feet + inch" and times to "hours + minutes + seconds", etc. I agree it would be nice to support this out-of-the-box, without having to write functions like
Good thing Numbat is not based on "unit types", but on "dimension types" 😄 [1] [2]. But seriously: I don't think our type system is going to be the problem. If anything, it helps. It makes sense to convert a height to Concerning syntax, I'm thinking we could do one of the following
The latter might be more intuitive, but the former makes more sense from a language-design perspective, I believe. [1] https://numbat.dev/articles/intro.html |
I am planning to add rudimentary support for (some) mixed unit representations in #501 |
Tenatively closing this for now, even if it feels not really "native" yet. |
Reopening this just to close it again, now that we have a much nicer solution, thanks to @Goju-Ryu: https://numbat.dev/doc/list-functions-other.html?highlight=dms#mixed-unit-conversion |
It would be great if Numbat supported unit lists out of the box à la Gnu Units. This allows units to be displayed in an effectively arbitrary "base" consisting of other units.
I understand that this may be tricky or conceptually incompatible with unit typing, but maybe it could make sense to have some short-hand to define unit list functions that convert to
String
. I'm thinking of something similar to thehuman()
time function, which currently does this manually in a pretty janky way. (Perhaps the real issue is that custom functions don't have the greatest ergonomics; I'll start a discussion expanding on that.)Could be nice to have proper support for unit lists as typed entities, though I haven't put much thought into whether that makes sense.
The text was updated successfully, but these errors were encountered: