sheetjs icon indicating copy to clipboard operation
sheetjs copied to clipboard

Format ending with '-' gives "Unsupported Format"

Open snoopyjc opened this issue 5 years ago • 2 comments

Some countries format negative numbers with the '-' on the right. Specifying this as a format gives an Unsupported Format error:

Format: #0;#0-
Value: -3.14
Expected: 3-
Actual: Error: unsupported format |0-|

snoopyjc avatar Oct 27 '20 21:10 snoopyjc

To fix this, don't include + or - in the numeric format unless proceeded by an "E".

snoopyjc avatar Oct 27 '20 21:10 snoopyjc

Excel autocorrects the format by escaping the slash. In Excel 2019, entering that format in Excel generates the format #0;#0\-. That format does work.

SheetJSDev avatar May 27 '22 05:05 SheetJSDev