Skip to the content

Uchusen Rockets宇宙船

Rockets drawn from sourced sizes: line drawings and painted 3D views you drop into a page, take apart and turn round, and a typed model that checks whether a rocket really goes together.

Uchusen is the Japanese word 宇宙船 for spaceship. About the name

Contents

Reference · Rockets, variants, parts and the fit check

scalePercentfunction

Clamps a size asked for to the slider's range and steps.

Import it

import { scalePercent } from "@johnmorrisdotca/uchusen-rockets";

Definition

function scalePercent(value: unknown): number

Parameters

NameTypeDescription
valueunknown

A number of per cent, or a string of one (an address's value).

Returns

number

A whole number of per cent between 60 and 100, stepping by 5; 100 when the value is not a number.

Examples

import { scalePercent } from "@johnmorrisdotca/uchusen-rockets";

console.log(scalePercent("73"), scalePercent("nonsense"), scalePercent(10));
75 100 60

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/uchusen-rockets 0.14.0.