Home › Forums › Quform WordPress › Export Rounding issue
- This topic has 3 replies, 2 voices, and was last updated 3 years, 2 months ago by Ally.
- AuthorPosts
- August 30, 2021 at 10:40 pm #33368PCLSITParticipant
I’m having the same issue as described in this post, but the recommended solution did not work for me.
We collect 14-digit library card numbers in our form, and when I export my entries as Excel or CSV, the numbers are rounded to the 100ths place (all end in 00). The numbers are stored correctly in the database, it’s only an issue with the export.
As recommended in the post I linked above, I tried adding the following code to functions.php, but it did not resolve this issue.
add_filter('quform_entry_exporter_value', function ($value, $sheet, $columnCount, $rowCount) { $style = $sheet->getStyleByColumnAndRow($columnCount, $rowCount); $style->getNumberFormat()->setFormatCode('#'); return $value; }, 10, 4);
What else can I try?
August 31, 2021 at 10:19 am #33377AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
August 31, 2021 at 7:59 pm #33385PCLSITParticipantThanks, Ally!
We are using Quform 2.14.2 and Excel 2016 (16.0.5188.1000).
It turns out I hadn’t tested the CSV export with the fix (# version). With the # fix, the Excel export still has the rounding issue, but the CSV is actually correct!
With no fix and with the @ fix, both CSV and Excel 2007 are incorrect (CSV has the number in scientific notation; Excel does as well, and when you click the cell, the function bar shows the number in regular format, but rounded).
Interestingly – exporting as Excel 2005 is correct, even with no fix in place.
I’m still interested in a fix for Excel 2007 format if possible, but I’m glad to have some export options that preserve the number!
I appreciate the help!
-AliceSeptember 1, 2021 at 9:57 am #33387AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.