誰でも助けてもらえますか?そのコードを使用することで、Excel フィールドからも値を取得できました。特定の列 = 5 の値があります。
public Integer Check4(int b) throws IOException {
InputStream myxls = new FileInputStream("book.xls");
HSSFWorkbook wb = new HSSFWorkbook(myxls);
HSSFSheet sheet = wb.getSheetAt(0); // first sheet
HSSFRow row = sheet.getRow(0); // first row
//HSSFCell cell0 = row.getCell((short)a); // first arg
HSSFCell cell1 = row.getCell((short)b); // second arg
cell1.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
System.out.println("smth "+ cell1);
return ;
}
ただし、そのようなコードの出力は次のとおりです。
"smth + 5.0"
var cell1 5.0 を 5 に変換する方法はわかりますか?Math.round、Integer.parseInt() は実際には役に立たない