Hacker News new | past | comments | ask | show | jobs | submit login

This is pretty slick, and I think very useful as-is.

But, while we're all posting wishlists, one thing that'd be nice is if it simplified unnecessarily complex compound units in the result. In the simplest case, it's able to do this, canceling out literally identical units that appear in both a numerator and denominator:

    > 2m/s * 2s
    4m
Obviously that is a better result than this hypothetical example would be:

    > 2m/s * 2s
    4 m·s/s
But if you use two different units of time, you get essentially a result like that worse one:

    > 2m/s * 2min
    4m·min/s
The unit m·min/s is not exactly wrong as a result here, but is unwieldy and a bit unusual as a unit of length. Since a "min/s" is just a scalar quantity, the scalar 60 (1 min/s = 60 s/s = 60), this simplifies to 240m.

You do get that result if you explicitly ask for it,

    > 2m/s * 2min -> m
    240m
But it'd be convenient to automatically get these kinds of simplifications, especially when dealing with more complex expressions.



Thank you for the feedback!

Absolutely agreed. This is on my priority list and there is already an open issue which is tracked here: https://github.com/sharkdp/insect/issues/37




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: