Skip to content
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

file.GetCellValue() has a number of problems.... #984

Closed
rbucker opened this issue Aug 6, 2021 · 5 comments
Closed

file.GetCellValue() has a number of problems.... #984

rbucker opened this issue Aug 6, 2021 · 5 comments
Labels
needs more info This issue can't reproduce, need more info

Comments

@rbucker
Copy link

rbucker commented Aug 6, 2021

GetCellValue does not seem to return the formatted value. Nor does it return the RAW value in the RAW datatype that was Set(). The SetCellValue() takes an interface{} value that it uses to determine which formatting to apply. That too is confusing... if the source was text then the type determination is on my code. But that it is not returned plain or formatted consistently is a challenge.

Thanks

@xuri
Copy link
Member

xuri commented Aug 7, 2021

Thanks for your issue, this library doesn't support all number formats currently, according to the documentation, GetCellValue will try to get formatted value from a cell, if it is possible to apply a format to the cell value, it will do so, if not will return the raw value of the cell. The SetCellValue always sets the raw value for the cell If you wanna set the number format of the cell, create a new style with the number format by NewStyle and then bind style with the cell by SetCellStyle, also ref #862.

@rbucker
Copy link
Author

rbucker commented Aug 7, 2021

In this particular case I was given a spreadsheet from a 3rd party and I dumped the rows and cols in TSV format. When the file was opened in Excel or google sheet there was an integer column that was presented as integer but getcellvalue returned a trailing '.0'.

I understand the reply. If this is not a bug or feature please feel free to close.

@xuri
Copy link
Member

xuri commented Aug 8, 2021

Did you mean GetCellValue returns incorrect number precision of decimal type value? Could you provide more details or a spreadsheet xlsx attachment without confidential info?

@rbucker
Copy link
Author

rbucker commented Aug 8, 2021

The value in the spreadsheet cell was '12345' but when I pulled the value with GetCellValue()... it returned '12345.0'. Sorry I do not have a working example.

@xuri
Copy link
Member

xuri commented Sep 7, 2021

I have tested it seems to work well, I'll close this issue, if you have any questions, info of code, and attachments to reproduce this issue, please let me know, and reopen this issue at any time.

@xuri xuri closed this as completed Sep 7, 2021
@xuri xuri added the needs more info This issue can't reproduce, need more info label Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info This issue can't reproduce, need more info
Projects
None yet
Development

No branches or pull requests

2 participants