简体   繁体   中英

read cell value preserve precision

I am Reading Excel using C# with
string cellvalue= worksheet.Cells[2, 2].Text; and the exact value in that cell is 0.0833333333333333 but the above code could only read value 0.083333333 which is the visible value in the excel sheet as well. this is cause of data loss/precision loss. how should i read the value of excel cell to get the 16 digit precision.

Thanks Charles, Value2 worked for me. Initially i was not able to find value2 on Cell. Then I used object rangeObject = sheet.Cells[row, column]; Range range = (Range)rangeObject; string cellValue; cellValue = rangeValue != null ? rangeValue.ToString() : 0.ToString()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM