New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Format ;($0.0)
#2559
Comments
@hy9be can confirm that is an issue as part of the second part of a conditional format. Simpler repro: SSF.format(';($0.0)', -200); |
;($0.0)
@SheetJSDev Are you guys looking into it? I could also try to fix it if you guys can give me some hint. The source codes do not have many comments. That makes it a bit hard to debug for me. |
The issue stems from this line SheetJS/ssf@d273a28#diff-2bf8a02964fc7c103bafd1eea1a85abdL126 |
I spent several hours yesterday trying to dig into this and come up with a fix, but was ultimately defeated by the complexity of the code. @SheetJSDev do you guys have some kind of grammar from which this code is generated? I found it really difficult to navigate with so many conditionals and single letter variables to juggle. I'm assuming everything in this repo is machine generated. If you're willing to let go of the source, I'd be happy to continue to dig in here. |
@n8agrin The "official grammar" is in [MS-XLS] 2.4.126 and there's an attempt to describe the behavior in ECMA-376 18.8.30-18.8.31 (pages 1776-1792 of the Fifth Edition PDF, I exported the relevant pages in a new PDF linked at the bottom of this comment). We started from there and quickly found it diverged from actual Excel behavior (our general opinion is that it's generally correct for the standard format codes but quickly degrades for anything remotely nonstandard). Incidentally, even Excel Online doesn't support custom number formats, probably because they also succumbed to the mess. The code you're looking at written by hand, and in retrospect we probably should have used more descriptive variable names. We're going to try to clean it up soon. The error in this case is in how the overflow is handled with the currency symbol. There's a weird trick in the Ecma Office Open XML Part 1 - Fundamentals And Markup Language Reference.pdf |
This is still a large issue for a project we are working on. I plan to look at it in the future but if anyone has a fix ready for this that would be great. |
I was having the same issue, I have created a pull request with a fix SheetJS/ssf#39 |
returns
The text was updated successfully, but these errors were encountered: