sheetjs
sheetjs copied to clipboard
Conditional Number Formats that only can match negative numbers shouldn't display the sign
In excel, if you have a number format, with a [condition], and that condition can only match negative numbers, then the sign of the value is suppressed. SSF.format incorrectly gives the sign. For example:
SSF.format('[Red][<=-25]General;[Blue][>=25]General;[Green]General;[Yellow]General', -25)
gives -25 instead of 25.
The test case in oddities.json line 153 is also incorrect.
Using format [Red][<=-25]General;[Blue][>=25]General;[Green]General;[Yellow]General in Excel 2019:

Using format [Red][<=0]General;[Blue][>=25]General;[Green]General;[Yellow]General in Excel 2019: