Convert excel cell text to poi number

HAI

I want to convert a cell text value to number in Excel using POI API.

the cell text value, such as "2.345", to be converted as a number.

How can i do this.

if anyone comes across this problem please let me know ...

+2


source to share


1 answer


If you have a value stored as a string then use:

String valueAsString = "2345";
cell.setCellValue(new BigDecimal(valueAsString).doubleValue());

      



If your value is a number, pass it to the direct method:

cell.setCellValue(2345);

      

+6


source







All Articles