-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Cell formatted as percentage does not return percent sign using GetCellValue if value is zero #1942
Comments
Thanks for your feedback. Could you provide the workbook as file attachment without confidential info? |
That workbook is fairly long and complex, so I tried to recreate it using a fresh Using this code:
on the attached workbook I got the following results:
which leads me to believe that either I am getting the cell value wrong or there is something in there that is not liking the idea of dividing by zero so it is just returning a raw zero. |
Additionally, I did check the loop for an error condition on any of the cell actions, and none of them produced errors, so I removed that check in the code for the sake of brevity. |
Thanks for your issue. This issue has been fixed, please upgrade to the master branch code by |
Thank you very much! I'll pull this down and test it out. |
… for zero numeric cell value (qax-os#1947) - Updated unit tests
Description
When reading a spreadsheet I am having problems getting the percent sign to show up for a cell that is formatted as
Percentage
when the value is zero. I had this failure with 0, 0.0, 0.00, etc. I am hoping that I am just doing something wrong in my code.Steps to reproduce the issue:
See Below
Describe the results you received:
In this snippet of code here I am checking two cells that are formatted in Excel as Percentage:
and I get these results:
When I set
RawCellValue
totrue
, I get these results:Describe the results you expected:
I expected the percent to be displayed when I get the cell value without the
RawCellValue
option set to true.Output of
go version
:Excelize version or commit ID:
Environment details (OS, Microsoft Excel™ version, physical, etc.):
MacOS is where I performed this test, but it also fails in different docker containers (Alpine Linux, Debian). Excel document was created in version 16.86, but other versions failed as well.
The text was updated successfully, but these errors were encountered: