sheetjs
sheetjs copied to clipboard
"General;General;-;General" is not working properly.
According to the format code structure(positive;negative;zero;text), I expected '-' for zero, but I got 0.
I think the problem here is using General as formatted code for positive section.
When I do not use General syntax for the positive section, I can get the desired result.
I've wrote some code snippets here for better understanding.
On the other hand, this is how Excel works. It is working even if I use General format code for positive section.

Could you help me how to figure this problem out?
Suggested fix:
// if(isgeneral(sfmt,0)) return general_fmt(v, o);
ov = v;
if(v instanceof Date) v = datenum_local(v, o.date1904);
var f = choose_fmt(sfmt, v);
// if(isgeneral(f[1])) return general_fmt(v, o);
if(isgeneral(f[1])) return general_fmt(ov, o);