Free Support Forum - aspose.com

GetCell(row- column) truncates digits

Hi,

I am tring to use GetCell to import cell that potential has 18 digits after the decimal point. But the getCell function only returns 15 digits. The rest is truncated. For example, I have 0.768491566012345678 in my .xlx. But the getCell returns only .768491566012345. Does anyone knows why? Is it the limitation os aspose?

Thanks alot!

Hi,

Thanks for considering Aspose.

No, Aspose.Cells for .NET / Java works in the same capacity as MS Excel provides. Are you using Aspose.Cells for Java, I tested you scenario a bit and could not reproduce the issue. Is the number stored as text or as numeric. Aspose.Cells will work in the same way with MS Excel. Could you post your sample code with template file to reproduce the issue. We will check it soon.

Thank you.

Hi Amjad

I am using it in .Net. The following is the sample code:

//=====code====

Decimal number;

IWorkbook wbk=app.OpenWorkbook(filename);

ws=wbk.GetWorksheet(sheetname);

number = ws.GetDecimal(3,4);

//code end

In the excel, the cell of row 3 column 4 is set to 0.768491566012345678. But the number read in is 0.768491566012345.

Thanks.

Hi,

Well, generally, MS Excel shows a numbered value upto 15 decimal places. If there is a number "0.768491566012345000" in a cell, MS Excel will show it as "0.768491566012345" in the formula bar.

If you want to get the value with all the 18 decimals, you may use Cell.StringValue property.

Thank you.

Are you saying this is the limitation on the MS excel.

I tried the Cell.StringValue, it only returns 9 digits after the decimal point though. For the above example, it only returns 0.768491566.

Thanks alot.

If I input 0.768491566012345678 to the cell in Ms Excel, it will be truncated as 0.768491566012345.

I think it is caused by double precision which is about 15~16 digits。