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.

All functions