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.

NUMERALS_PACKAGE

const NUMERALS_PACKAGE: IEnginePackage;

Defined in: packages/engine/src/packages/numerals/NumeralsPackage.ts:35

Numeral spellings (issues #248, #249): a number in words, as an ordinal, or in Roman numerals, and Roman numerals back to a number.

as words, as ordinal and as roman extend the general as-converter set; "MMXXIV" from roman is the reverse. The reverse takes a quoted string rather than a bare MMXXIV literal on purpose: the Roman digits M C D L X V I are already units and variable names (V the volt, C Celsius), so a bare literal would be ambiguous. On by default and removable.

Roman numerals cover the classic 1 to 3999; a value outside that, or a malformed Roman string, is answered with a structured Error. Words use British spelling and the “and” of “one hundred and five”.