convert unit(target unit, source number)target number Type: For any units u, v(@apply Unit(u), Number{v}) -> Number{u}

Converts a number from one unit to another (if possible).

Unit conversion is only available for exact conversions (e.g. metres to centimetres), not for approximate or changing conversions (e.g. euros to dollars).

Attempting to convert between unrelated units (e.g. metres to seconds) will result in an error. This includes converting to/from plain numbers. If you want to add a unit to a number multiply by 1 of that unit (for example, duration * 1{s}), if you want to remove a unit then divide by 1 of that unit (for example, distance / 1{m}).

ExamplesClick an example to insert it
convert unit(unit{cm}, 1{inch})2.54{cm}Convert one inch into centimetres
convert unit(unit{l}, 30{cm} * 20{cm} * 10{cm})6{l}Convert a volume in cubic centimetres into litres
convert unit(unit{mile/hour}, (100{m} / 9.58{s}))23.350{mile/hour} ± 0.001{mile/hour}Convert speed running 100 metres in 9.58 seconds into miles per hour
convert unit(unit{m^2}, 10{m})errorTry to convert between unrelated or impossible units (here: length and area) gives an error.