开发者

convert excel cell text into number poi

HAI

i want ot convert a cell text value into a number in Excel using POI AP开发者_C百科I.

cell text value like '2,345' to conver as a number.

How can i do that.

if any has face this problem,please let me know...


In case you have the value stored as a String, use:

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

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

cell.setCellValue(2345);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜