Setting Excel cell value in Numeric format using POI

后端 未结 4 1926
忘掉有多难
忘掉有多难 2021-02-19 04:33

I want to store numeric data in excel sheet.
The numeric data is represented by String type in my java code.
Is it possible to set it as numeric without casting it?

4条回答
  •  感动是毒
    2021-02-19 05:27

    Try to use wrapper classes:

    dCell.setCellValue(new Double(112.45));
    

    BTW, it will work if you simply give the value instead of the double cotes as follows:

    dCell.setCellValue(112.45);
    

提交回复
热议问题