We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Data showing Exponential value in Excel Report

Hi,
CSV sheet which has data like 5641E11,6411E11,6678E12, showing in excel exponential value after merging CSV. Attached ZIP file having CSV sheet1 and Report excel.ASPOSE JAR MERGE ISSUE.zip (6.0 MB)

@PrasunaKota,

This is not an issue with Aspose.Cells by any means rather MS Excelโ€™s behavior. For confirmation, you may open a new Workbook in Ms Excel manually and input some scientific value(s) e.g โ€œ6411E13โ€ into a cell (e.g A1) and then press Enter, you will notice that it will return/display as โ€œ6.41E+16โ€. To cope with it, you may try the following sample code, it will work for your needs:
e.g
Sample code:

TxtLoadOptions opts = new TxtLoadOptions(LoadFormat.CSV);

        opts.setSeparator('|');
        opts.setConvertNumericData(false);


        Workbook workbook = new Workbook("e:\\test2\\daee92570a82f94127a238432a9bb37c_Sheet1.csv", opts);
        workbook.save("f:\\files\\out1.xlsb", SaveFormat.XLSB); 

Hope, this helps a bit.

@Amjad_Sahi

Tried using below code, still getting exponential value on CSV file.

var txtLoadOptions = new TxtLoadOptions();
txtLoadOptions.Separator = delimiter;
txtLoadOptions.ConvertDateTimeData = false;
txtLoadOptions.ConvertNumericData = false;

var excelFile = new Workbook(csvFileLocation, txtLoadOptions);

Example value: 25460E281
Getting this exponential value: 2.55E+285
Aspose.Cells Version: 7.2.0.0

@carlito.containerize,

Since you are using an older version of the product (Aspose.Cells v7.2.0.0), so we cannot evaluate your issue. Neither we could include any fix to the older version. We recommend you to kindly upgrade to and try latest version of the APIs (e.g. Aspose.Cells 21.7) and then try your scenario/case. If you still find any issue, kindly do share your template CSV file, we will check it soon.

PS. please zip the file(s) prior attaching here.

1 Like