Reference · Rockets, variants, parts and the fit check
scaleFactorfunction
The factor a size in per cent asks for: 1 for any craft that does not take the slider, and the size between 60 and 100 per cent, in steps of 5, for a concept.
Import it
import { scaleFactor } from "@johnmorrisdotca/uchusen-rockets";
Definition
function scaleFactor(rocket: string, variant: string, percent: unknown): number
Parameters
| Name | Type | Description |
|---|---|---|
rocket | string | A rocket's id. |
variant | string | A variant's id. |
percent | unknown | The size asked for, in per cent, or the text of one. |
Returns
number
A number from 0.6 to 1; 1 for a craft that does not scale.
Examples
import { scaleFactor } from "@johnmorrisdotca/uchusen-rockets";
console.log(scaleFactor("fleet-emiake", "fleet-emiake", "80"), scaleFactor("saturn-v", "saturn-v", 80));0.8 1What it prints (run when this page was built)