/ maskitoNumberOptionsGenerator to create a mask for entering a formatted number. maximumFractionDigits parameter to configure the number of digits after decimal separator. decimalSeparator and thousandSeparator to get mask with locale specific representation of numbers. postfix parameter to set non-removable text after the number. maskitoCaretGuard to clamp caret inside allowable range. max parameter. Use minimumFractionDigits to always show trailing zeroes.
Non removable dollar sign is achieved by using prefix parameter.
Use minusSign parameter to configure the character which indicates that a number is negative.
In this example hyphen is used as minusSign
negativePattern property to configure order of prefix and minus sign (by default, prefix is always placed before minus). Use thousandSeparatorPattern to customize digit grouping. Provide a function that receives raw integer digits as a string and returns them split into groups, left-to-right.
This example implements 4-digit grouping for Japanese yen — the traditional 万 (10 000) counting system: ¥1,2345,6789.
Intl.NumberFormat.formatToParts to derive the grouping from a browser locale automatically. Pass the result to thousandSeparatorPattern parameter.