Format ;($0.0)
#2559
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#2559
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
returns
@hy9be can confirm that is an issue as part of the second part of a conditional format. Simpler repro:
@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
d273a28d54 (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
eval_fmt
function to determine where the decimal point starts and draw digits. The reason for this trick is apparent when considering formats like###0 "Million" 000 "Thousand" 0 "Hundred" 00
: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