Hi,
I am trying to round off the decimal number with precisaion value 2, but it
is not working, let me know the problem in my below code:
CellStyle cs = wb.createCellStyle();
DataFormat df = wb.createDataFormat();
cs.setDataFormat(df.getFormat("0.0"));
for (int i=14;i<rows;i++)
{
Cell y= wb.getSheetAt(0).getRow(i).getCell((short)
colValue);
if (y.getCellType() == Cell.CELL_TYPE_STRING) {
} else if (y.getCellType() == Cell.CELL_TYPE_NUMERIC) {
float d=(float) y.getNumericCellValue();
y.setCellStyle(cs);
}
}
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/round-off-digits-in-apache-poi-ss-workbook-tp5713755.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]