fn

maskNumberOptions

v0.0.14

Mask options for a formatted number: optional thousands grouping, decimal precision, sign, prefix/postfix, and a live upper-bound clamp. The unmasked value is the canonical, separator-free number string.

Example

ts
maskNumberOptions({ thousandSeparator: ',', precision: 2, prefix: '$' });
// typing 1234.5 → '$1,234.5'

Signature

ts
export function maskNumberOptions(params: MaskNumberParams ={ ... }

Parameters

ParameterTypeDescription
params?MaskNumberParamsFormatting options

Returns

MaskOptionsReady-to-use mask options
PropertyTypeDescription
maskMaskThe mask pattern (or a function of state).
preprocessors?readonly MaskPreprocessor[]Normalizers run before conforming.
postprocessors?readonly MaskPostprocessor[]Finishers run after conforming.
overwriteMode?OverwriteModeInsert vs overwrite behavior.