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.
Parameters
Section titled “Parameters”pace500Seconds
Section titled “pace500Seconds”number
Pace as seconds to cover 500m (the SDK’s canonical normalized pace).
paceUnit?
Section titled “paceUnit?”"per500m" | "per1000m" | "perMile"
The unit to render in; defaults to 'per500m'.
Returns
Section titled “Returns”string
A display string such as "2:15.3", "4:30", or "--:--".
Example
Section titled “Example”formatPace(135, 'per500m'); // "2:15.0"formatPace(135, 'perMile'); // firmware-parity /mile rendering