formatDistance

function formatDistance
packages/shared/src/units.ts:126
formatDistance(m: number, digits: number) → string

Pick the unit a human would use at this magnitude and format it.

Deliberately spans the whole range the game does — an inch-scale readout and a kiloparsec readout come out of the same call, because the HUD shows one distance field whether you are docking or crossing the galaxy.

mnumber
Undocumented
digitsnumber
Undocumented
Returnsstring