Skip to content

This site describes solve-engine as it is on main: 2.43.0, which npm does not have yet. npm installs 2.40.0, so a page may show an answer that version does not give yet.

DERIVED_UNITS_PACKAGE

const DERIVED_UNITS_PACKAGE: IEnginePackage;

Defined in: packages/engine/src/packages/derived/DerivedUnitsPackage.ts:55

Named derived units on output (issue #191). Multiplying two compatible quantities composes their dimensions in the VM (see uom/Dimensions.ts); this package supplies the as <named unit> readouts and the m/s^2 acceleration literal. On by default and removable.

The as targets are registered under their own spellings. A name is matched as typed first, so as mW is milliwatts and as MW megawatts (issue #824); a spelling that matches none (as n, as KWH) falls back to the lower-cased name, which reaches the one unit it can mean, and a lower-cased name two units share (as mw) is refused by name rather than read as either.