Skip to content

units

@rogue/console-sdk/units — pure, tree-shakeable, platform-neutral firmware-parity math and display formatting (SDK_PLAN.md §3.6.9, row 77).

These functions carry no React or React Native imports so they are usable by server code and non-RN consumers. They deliberately preserve the console firmware’s truncation quirks (the MILE_TO_KM_FACTOR = 0.6215 float, the +0.0005 mile bias, uint32 millisecond pace truncation, decisecond SPM truncation, app_motion.c power/calorie tiers) as documented spec: values must match what the physical console screen shows — firmware parity is a correctness requirement, not an approximation.

The only non-value import is a type-only import of DisplayUnits from the SDK’s ids module (itself dependency-free), which the TypeScript compiler erases entirely — the emitted JavaScript pulls in nothing but this file.