Reference · Rockets, variants, parts and the fit check
figureWordsfunction
A figure as words for a table: its value and whatever must stay beside it; a blank says why, or that no source gives it.
Import it
import { figureWords } from "@johnmorrisdotca/uchusen-rockets";
Definition
function figureWords(figure: Figure<number | string> | undefined, unit?: string): string
Parameters
| Name | Type | Description |
|---|---|---|
figure | Figure<string | number> | undefined | A figure, or undefined. |
unit (optional) | string | Text to put after a number, such as " m". Optional. |
Returns
string
The figure as words for a table. A blank gives its brief, or "No source" when it has none.
Examples
import { figureWords, variantOf } from "@johnmorrisdotca/uchusen-rockets";
console.log(figureWords(variantOf("starship", "v3")?.facts.height, " m"));124.4 mWhat it prints (run when this page was built)