GNU Units
15 points by op
15 points by op
If you have any interest in metrology, the definitions file (debian sources link) is very well-commented and includes a lot of interesting historical tidbits.
Some of the desk calculator features are very nice as well. For example, there are two multiplication operators (* and space) and two division operators (/ and |), the latter of each pair being higher precedence than either of the former, so 1 m / 5 s is in m/s, not meter-seconds.
I definitely recommend reading the manual if you plan to use affine conversions, such as temperature. Scale conversions (that is, a temperature in Fahrenheit to the same in Celsius) and degree conversions (my terminology, I don't remember what units calls it; some number of degrees Fahrenheit to a number of degrees Celsius representing the same temperature delta) are both supported, which is useful but I struggle to remember how to invoke the one I want.
Also! It supports various global versions of imperial measures, and will pick a default for what a pound fluid ounce (EDITED: see fanf's comment below) is based on your locale. However, the other local variants are available prefixed, so if you have a recipe from somewhere else in the world that you're localising (or better yet, metricising) then it's very useful for that.
pick a default for what a pound is based on your locale
Pounds vary by field of work or kind of material, not by location. The usual pound everywhere that uses pounds is the pound avoirdupois, except that precious metals use the troy pound.
It supports that too!
You have: 1 pound
You want: troypounds
* 1.2152778
/ 0.82285714
but yes, I was thinking of volume measures. I've fixed my comment :)
i discovered GNU Units via https://blog.winny.tech/posts/some-usescases-for-gnu-units/ which is a good intro by example to the program!
GNU Units is great. It's been around forever and it very likely already installed on your machine.
Though these days I've been using https://numbat.dev/ for my unit conversion needs. It says open 24/7 in a tmux pane, and does more than just unit conversion (I use it all the time for time arithmetic)
GNU Units is incredible! It has completely replaced any kind of other calculator program for me, and can do so, so much more. I made a small auto updating prompt for XMonad that essentially just runs units -t in a loop, and displays the result in the prompt. This way, one doesn't even need to switch away to another window to e.g. check how much an lbs was again