Function

nerdamer.setConstant

src/index.ts:592
nerdamer.setConstant(name: string, value: string | number): typeof nerdamer

Registers or removes a parser constant using the legacy public entry point. Numeric values are converted to exact rational text before registration so they do not introduce decimal-formatting intent. The string 'delete' removes the constant. Registration changes shared parser state.

Parameters

NameTypeDescription
namestringConstant name.
valuestring | numberConstant value, or 'delete' to remove it.

Returns

typeof nerdamer — The root nerdamer function for chaining.