← Back to context

Comment by Symbiote

7 months 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.

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

  $ units --terse 2.4kWh megajoules
  8.64