to

x to unit

to(x, unit)

Try it yourself:


to(): convert a quantity to a unit

to(value, unit) converts a quantity into a requested compatible unit. It keeps the underlying physical quantity while changing its representation.

Example

Convert a length, mass, duration, or temperature only to a compatible target. The result is easier to report but should represent the same measurement.

Related tools

Use toBest() for a readable automatic unit, format() for display, add() for compatible quantities, and compare() to order values.

Caveat

Conversion cannot repair incompatible dimensions. Be explicit about offsets such as Celsius versus Kelvin.

Try To in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions