Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^3: Spreadsheet::Read module is rounding the decimals in XLSX fileby Tux (Canon) |
on Jun 24, 2015 at 13:34 UTC ( [id://1131808]=note: print w/replies, xml ) | Need Help?? |
I obviously was not clear enough. Spreadsheet::Read is no more and no less than a wrapper over a bunch of spreadsheet parsers to feature a generic API to all forms of spreadsheets. ReadData does not alter the data being returned by the underlying parser effectively in use. If it does, it might well be a bug. The underlying parser in the case of the OP's problem is likely Spreadsheet::XLSX, which is a problem to start with. That module is (very) buggy and unmaintained. It parses the XML with regular expressions and is loaded with small but annoying mistakes. My advice would be to uninstall that module immediately and replace it with Spreadsheet::ParseXLSX. There is a major chance your problems will vanish. Even with the use Spreadsheet::XLSX; statement in the code, which is utterly useless here, it does not guarantee that that module is used anywhere. If Spreadsheet::Read finds Spreadsheet::ParseXLSX installed, it will use that instead. So let us assume that with Spreadsheet::ParseXLSX your value will always return 0.98880000000000001 (or whatever floating point value is actually stored in that cell). It is still not Spreadsheet::Read's problem in that it is different on different systems. Find out what parser is used and trace back if the difference still exists when you parse the spreadsheet with that module (peel the layers): it might be that even lower levels are to blame like XML::Twig. I personally think that sundialsvc4 overreacts, though basically right, I don't see freshman-bashing here. Just valid tips and tricks that might need some more friendlyness in their wording, but are certainly not unfriendly IMHO. (There are reasons for people to not use Spreadsheet::ParseXLSX, support for Spreadsheet::XLSX::Reader::LibXML is work in prgress) Enjoy, Have FUN! H.Merijn
In Section
Seekers of Perl Wisdom
|
|