JXL Number Format and Cell Type

人走茶凉 提交于 2019-12-05 01:42:50

I'm sorry if this is not what you want. But, what I understand about your needs is to have cell type=number with 1 decimal place. It is possible for you to define your own number formats. You can use this format ("#.0") to get what you want (eg: 900.0,23.0,34324.0 and .etc)

NumberFormat decimalNo = new NumberFormat("#.0"); 
WritableCellFormat numberFormat = new WritableCellFormat(decimalNo);
//write to datasheet
Number numberCell = new Number(0, 0, 25, numberFormat); 
excelSheet.addCell(numberCell);
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!