I have an excel *.xlsx
with a cell of type Número
, the value that I have in the excel is 0,0794497914814776
but the value that the method returns celda.getNumericCellValue()
is:0,07944979148147759987
I have tried to convert the cell to text before reading it, but it throws me an exception:
celda.setCellType(CellType.STRING);
String a = celda.getStringCellValue();
This that I show helped me to read another excel, with a custom cell format.
The main problem I have is that the cell can contain 5, 10 or 15 decimal places and we need to respect the value that comes in the excel.
Can you read the exact value of the cell?
It is a floating point management problem, which happens in any programming language, I give you an example in Java:
To convert to text you can try NumberToTextConverter , a class created to do precisely what you intend.