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.

All functions