Skip to content

formatPace

formatPace(pace500Seconds, paceUnit?): string

Defined in: console-sdk/src/units/index.ts:547

Formats a pace as the console’s M:SS / M:SS.t string, converting the incoming seconds-per-500m value to the requested PaceUnit first.

The whole-seconds display truncates (Math.floor) rather than rounds, to match the console. A zero or missing pace renders as --:--. Tenths are shown only for per500m; the derived per1000m / perMile renderings show whole seconds, mirroring how the console labels those units.

number

Pace as seconds to cover 500m (the SDK’s canonical normalized pace).

"per500m" | "per1000m" | "perMile"

The unit to render in; defaults to 'per500m'.

string

A display string such as "2:15.3", "4:30", or "--:--".

formatPace(135, 'per500m'); // "2:15.0"
formatPace(135, 'perMile'); // firmware-parity /mile rendering