Hacker News new | ask | show | jobs
by Symbiote 352 days ago
I usually call it non-interactively:

  $ units 1500DKK USD
      * 236.76653
      / 0.00422357
in which case it's always the first line I want.

(The second line is telling me 1USD is 0.00422357 of 1500DKK.)

Note if you use the currency conversions,

  systemctl enable units-currency-update.timer
is needed to keep them up-to-date.
1 comments

If you only need the first line you can invoke units with --terse.

  $ units --terse 2.4kWh megajoules
  8.64