Closed sunnyawake5 closed 1 month ago
That seems to be correct behavior. 0.00_
is not a legal format pattern and should throw an error.
If you want the formatter to handle invalid patterns for you, you need to enable that via an option:
format("0.00_", 12.34, { throws: false }); // → "######"
Also, consider - if you think this pattern comes from a trusted source, that you may have an error in you application that it is trimming the pattern strings where it should not: 0.00_
is a valid pattern.
0.00 parse error: SyntaxError: Illegal character: 0.00 (at parseFormatSection.js:436:13) at parseFormatSection (parseFormatSection.js:436:13) at parsePattern (parsePattern.js:48:12) at prepareFormatterData (index.js:45:19)