sheetjs icon indicating copy to clipboard operation
sheetjs copied to clipboard

Conditional Number Formats that only can match negative numbers shouldn't display the sign

Open snoopyjc opened this issue 5 years ago • 2 comments

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.

snoopyjc avatar Sep 23 '20 17:09 snoopyjc

The test case in oddities.json line 153 is also incorrect.

snoopyjc avatar Sep 23 '20 17:09 snoopyjc

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

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

B

reviewher avatar Apr 06 '22 01:04 reviewher