I am trying to read an excel file and validate the values.
While reading one of the columns which has decimal values, the digits after the decimal point are not correctly retrieved. Suppose, I am trying to read -117035791.877483 number but the result I am retrieving is -1.1703579187748297E8 (which is in exponential format and don’t want that format) if I directly read using below method.
double d = cell.getNumericCellValue();
I also tried converting the same number to decimal first as below code, but it is adding more digits after decimal point like -117035791.87748297.
String s = BigDecimal.valueOf(cell.getNumericCellValue()).toPlainString();
I also tried to retrieve value directly as String value but still, the problem persists. Please suggest the way through which I will get Exact value with decimal points from excel.
Source: Read More