https://issues.apache.org/bugzilla/show_bug.cgi?id=57202

            Bug ID: 57202
           Summary: Upgrading from POI 3.9 to 3.10.1 giving invalid
                    fraction value in csv
           Product: POI
           Version: 3.10-FINAL
          Hardware: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: SS Common
          Assignee: [email protected]
          Reporter: [email protected]

We are trying to upgrade our POI implementation from 3.9 version to 3.10.1,
when doing so we encountered the below problem. 

Excel fraction value getting converted incorrectly in csv file. Sample input 

Cell format in Excel : Fraction - Up to one digit (1/4)
Cell value in Excel : 44022813230178
Displayed value in Excel : 44022813230178

In Apache POI 3.9 version converted csv file for the about input file is

POI 3.9 csv file value : 44022813230178

Where as in POI 3.10-FINAL and 3.10.1 versions the output is incorrect

POI 3.10.1 and 3.10-FINAL csv value : 2147483647

Java code used 
formatter = new DataFormatter(true);
csvLine.add(formatter.formatCellValue(cell));

When i debug into the code of org.apache.poi.ss.usermodel.FractionFormat class,
in the method format(Number num) I see a possible bug. The double value is
getting converted into 'int'. 

In the line number 123, sb.append(Integer.toString((int)wholePart));  there are
multiple palaces where its converted to 'int'.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to