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.
Utilities
Section titled “Utilities”- MetricsModality
- PaceUnit
- BIKE_CAL_BASE_COEFFICIENT
- JOULES_PER_KILOCALORIE
- METERS_PER_KILOMETER
- METERS_PER_MILE
- MILE_TO_KM_FACTOR
- ROWER_CAL_HR_BMR_OFFSET
- ROWER_POWER_COEFFICIENT
- bikeFactorFromCalRate
- bikeFactorFromWatt
- computeAvgPower
- computeBikeAvgPower
- computeBikeCalPerHour
- computeBikeRpm
- computeCalPerHour
- computePace1000
- computePace500
- computeRecordSplitMetrics
- computeSpm
- formatDuration
- formatPace
- formatPaceTime
- isBikeModality
- metersToKilometers
- metersToMiles
- pace500To1000m
- pace500ToMile