I'm trying to insert the BigDecimal value in excel but it is storing as exponential value.
The value is storing as exponential value with below code: i/p: 1234567891012.12 o/p: 1.23457E+12
cell = rowhead.createCell(cellnumberno++);
cell.setCellStyle(wrapRightDataNoBottomCellStyle);
cell.setCellValue(Double.parseDouble(cellValue));
when i'm trying to insert value in excel with below, then i'm getting error like "Number is strored as string": i/p: 1234567891012.12 o/p: 1234567891012.12 with exclamation mark
cell = rowhead.createCell(cellnumberno++);
cell.setCellStyle(wrapRightDataNoBottomCellStyle);
cell.setCellValue(cellValue);
Is there a way to remove this number is stored as text error from java code before entering value.
Formatting as below is working fine but i dont want to restrict the number after decimal.
XSSFDataFormat format=wb.createDataFormat();
wrapRightDataNoBottomCellStyle.setDataFormat(format.getFormat("0.00"));
cell.setCellStyle(wrapRightDataNoBottomCellStyle);
cell.setCellValue(Double.parseDouble(cellValue));
I dont want to format the cell with something like this "0.00", is there a way where i can set cell format to text and then enter the value and still avoid the number as text error?
I want insert the long decimal like below in excel as a string by avoiding "number stored as text" error. Input : 1234567891012.12222 Expected o/p: 1234567891012.122222
Please help me, any pointers would be of great help.