Spreadsheet::ParseExcel vs Spreadsheet::XLSX, significant figures and rounding

337 views
Skip to first unread message

Ian Ewing

unread,
Mar 13, 2014, 2:50:08 PM3/13/14
to spreadsheet...@googlegroups.com
Hi All,

I am trying to convert some perl to parse .xlsx instead of .xls. Everything seems to be working just fine except for number rounding and/or # of significant digits.

I wrote the same data out in .xls and .xlsx formats, the spreadsheets are identical.

When I parse the data however I run into the following problem.
Example:
28.95000007629395 from  worksheet.xls
28.95                      from  worksheet.xlsx

-0.049999997019     from  worksheet.xls
-.05                        from  worksheet.xlsx

The only thing I have changed is the module for parsing excel spreadsheets from ParseExcel to XLSX. All the formatting subroutines remain the same.


I am using XLSX 0.13 and ParseExcel 0.59 with perl 5.8.8 on red hat enterprise 5.8. I cannot post the code as it is proprietary, I know that is in bad form, but there is not much I can do about it. Has anyone run into this before?

Thanks
Ian


Ian Ewing

unread,
Mar 17, 2014, 9:11:00 AM3/17/14
to spreadsheet...@googlegroups.com
I came across the answer on Perl Monks. It turns out $cell->Value removes any formatting, a quick change to $cell->{Val} solved that issue.
Reply all
Reply to author
Forward
0 new messages