poi excel导入整数数字自动加小数点解决

private String numberFormat(Cell cell){
		NumberFormat numberFormat = NumberFormat.getInstance();
		// 不显示千位分割符,否则显示结果会变成类似1,234,567,890
		numberFormat.setGroupingUsed(false);
		if (cell == null) {
			return "null";
			}
			String value = cell.toString();
			int i = cell.getCellType();
			if (i == 1) {//字符串类型
			return value;
			} else {
			value =numberFormat.format(cell.getNumericCellValue());
			return value;
			}
	}

  

posted @ 2019-12-26 16:42  那时·此刻  阅读(4453)  评论(0编辑  收藏  举报
/* 看板娘 */