socrtwo's Avatar
socrtwo 4
18 Asked
50 Answered
5 Best
0
No one has voted on this question yet :(
3 years ago

In Perl the xls2csv function from Spreadsheet::XLSX::Utility2007 rounds off to two decimal places, why?

I am writing a Perl/Tk script which displays Excel worksheets using the ss2tk example script from the Spreadsheet::Read module. It does not round off 2 decimal places but the function from Spreadsheet::XLSX::Utility2007 does round off to two decimal places. Why? I'm trying to use that 2nd function as a feature of my program to offer conversion of the displayed worksheets to CSV files.
Tip for best answer: M$22.00
Separate topics with commas, or by pressing return. Use the delete or backspace key to edit or remove existing topics.

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

What is Your Answer?

0
0
0

2 Answers

2
mritty's Avatar
mritty | 3 years ago
4
On line 987 of Utility2007.pm, change

$output .= $cell->Value if(defined $cell);

to

$output .= $cell->unformatted if(defined $cell);

and then save your changes and reinstall the module if you edited the build copy instead of the installed copy.

I can't guarantee that will work, but from reading the docs, it would seem to....

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

Report Abuse

Post Reply Cancel
0
adrianarcher's Avatar
adrianarcher | 3 years ago
3
It might be uncouth to suggest it, but you should ask this on stackoverflow.com, I bet you'll get an answer there if you don't find one here!

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

Report Abuse

Post Reply Cancel

Learn something new with our FREE educational apps!

Private lessons in the comfort of your own home. Get back in shape or finally pick up a guitar with our great experts guiding you the whole way!
Learn Guitar
Learn Hip Hop
Learn Pilates