Reference · Journey mode: transfers, launch windows and flip-and-burn trips
percentOfLightfunction
The share of the speed of light, with enough digits that it is never rounded up to 100: 99.999 999 99 % for a speed a hair under c.
Import it
import { percentOfLight } from "@johnmorrisdotca/uchusen-rockets/journey";
Definition
function percentOfLight(ms: number): string
Parameters
| Name | Type | Description |
|---|---|---|
ms | number | Metres a second. |
Returns
string
The percent, in groups of three digits.
Examples
import { percentOfLight } from "@johnmorrisdotca/uchusen-rockets/journey";
console.log(percentOfLight(29_780), percentOfLight(299_792_457.9999));0.0099 % 99.999 999 999 966 63 %What it prints (run when this page was built)