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

Do you know about the `units` command?

  $ units
  Currency exchange rates from www.timegenie.com on 2017-08-24 
  2980 units, 109 prefixes, 96 nonlinear units
  
  You have: 5 lbs
  You want: kg
  	* 2.2679619
  	/ 0.44092452
  You have: 100 furlongs
  You want: meters
  	* 20116.8
  	/ 4.9709695e-05
  You have: 100 miles/hour
  You want: meters/second
  	* 44.704
  	/ 0.022369363
  You have: 2 kiloisraelnewshekels
  You want: picodollars
  	* 5.5271109e+14
  	/ 1.8092635e-15



I like `qalc` a lot:

    > 5 pounds to kg
    5 * pound = approx. 2.2679619 kg

    > x^2 + 8*x = 4
    ((x^2) + (8 * x)) = 4 = approx. x = 0.47213595 or x = -8.472136
And so on.


I didn't know about that! Strange interface, though -- why isn't the first response just "2.27kg"?


Because a kg goes into 5 lbs 2.2679619 times, and 5 lbs goes into 1 kg 0.44092452 times.


The first number is the one I want, pretty much 100% of the time, and I hardly ever need 8 digits of precision.


Units absolutely rocks. It can do quite complex calculations as well, and you can add to the units it knows.




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

Search: