0
소수점 이하 다섯 자리가 포함 된 셀에 내용을 인쇄하려고하면 자동으로 숫자가 3d.p로 반올림됩니다. 셀 유형을 검사 한 후JXL API 문제 : 실제 숫자 대신 십진수를 반올림 한 표준 출력 표시
Cell cellNum = sheet1.getCell(col,row);
WritableCell cell = sheet1.getWritableCell(col, row);
if (cell.getType() == CellType.NUMBER){
cellNum = sheet1.getCell(col,row);
NumberFormat fivedps = new NumberFormat("#.#####");
WritableCellFormat cellFormat = new WritableCellFormat(fivedps);
cell.setCellFormat(cellFormat);
String cellContent = cellNum.getContents();
System.out.print(cellContent + "\t");
}
else{
// Cell cellNum = sheet1.getCell(col,row);
String cellContent = cellNum.getContents();
System.out.print(cellContent + "\t");
정말 고마워요. 그것은 효과가있다! 표시된 값은 스프레드 시트의 값과 동일합니다. –