sheetjs
sheetjs copied to clipboard
Number format with condition that matches negative numbers gives incorrect output
Format with a condition and including a - sign loses the extra - sign:
console.log(SSF.format('[<=9999999]###\\-####;\\(###\\)\\ ###\\-####', -12.3))
-12.3
Excel gives --12.3 (one from the \- and one from the negative number).
Possibly related, this one is wrong too:
console.log(SSF.format('[=0]?;#,##0.00', -12.3))
12.3
(loses the - sign)
This one was difficult!!
Found another bad test case in oddities.json:
["[Red]General ;[Blue]General\\ ;[Green]Generalp;[Yellow]General'",
[50, "50 "],[0,"0p"],[-25,"-25 "],["foo","foo'"]],
should be:
["[Red]General ;[Blue]General\\ ;[Green]Generalp;[Yellow]General'",
[50, "50 "],[0,"0p"],[-25,"25 "],["foo","foo'"]],