unit

Print human readable units (e.g. time in days, hours, minutes or distance in km, m, cm, mm).

Members

Functions

mostSignificant
auto mostSignificant(Unit.Part[] parts, long nr)

get the first nr of parts (or less if not enough parts are available).

onlyRelevant
auto onlyRelevant(Unit.Part[] parts)

get only relevant parts of an part array. relevant means all details starting from the first non 0 part.

Structs

Unit
struct Unit

A unit allows to easily print mixed resolution values. Typical examples include time (with hours, minutes, ...) and distances (with km, m, cm, mm). The unitclass simplifies definition of such things as well as transforming a high resolution value, to a supposedly more human readable representation. e.g. 3_610_123 would convert to 1h 0m 10s 123ms.

Meta