Unit conversions

Unit conversions can be performed through the convert(...) function.

[> convert( 60, 'units', 'km/h', 'mph' ); # Convert 60 km/h to mph

$\frac{156250}{4191}$

[> convert( 60.0, 'units', 'km/h', 'mph' );

$37.28227153$

The format is convert( value, 'units', 'units-from', 'units-to' ).

If you simply want the conversion factor, just convert $1$ or $1.0$. If the first argument is a floating-point number the result will be evaluated to a floating-point number.

[> convert( 1, 'units', 'N/m^2', 'lb/ft/s^2' );

$\frac{30480000}{45359237}$

[> convert( 1, 'units', 'month[lunar]', 'days' );

$29.53058796$

[> convert( 1.0, 'units', 'furlongs/fortnight', 'm/s' );

$0.0001663095238$

Dimensions

You can also convert a unit into its dimensions:

[> convert( 'furlongs/fortnight', 'dimensions' );

$speed$

[> convert( 'furlongs/fortnight', 'dimensions', 'base' );

$\frac{length}{time}$

Energy conversions

Especially in chemistry, it is necessary to perform energy conversions. For example,

[> convert( 1, 'units', 'C', 'm/s' );
Error, (in convert/units) unable to convert `C` to `m/s`
[> convert( 1, 'units', 'C', 'm/s', 'energy' );

$0.6376803629 \times 10^{26}$

[> convert( 1, units, 1/cm, K, energy );

$1.438777364$

While fascinating, energy conversions will not be of significant use to engineers.