Export Rounding issue

Home Forums Quform WordPress Export Rounding issue

This topic is: not resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #33368
    PCLSIT
    Participant

    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?

    #33377
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #33385
    PCLSIT
    Participant

    Thanks, 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!
    -Alice

    #33387
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy