toBest

toBest(x)

toBest(x, unitList)

toBest(x, unitList, options)

Try it yourself:


toBest(): choose a readable unit

toBest(quantity) converts a quantity to a unit that is convenient for people to read, often choosing a scale that avoids an awkward number of zeros.

Presentation aid

A long duration may become minutes or hours; a small distance may become millimetres. The physical amount does not change, only the display unit.

Related functions

Use to() when you require a specific unit, format() to choose decimal presentation, round() for displayed precision, and numeric() when an approximate number is required.

Caveat

Automatic selection is convenient, but reports and APIs may need a fixed unit for consistency.

Try To Best 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