From 61eb060bfa53410a9c638056acc8b9e02282454f Mon Sep 17 00:00:00 2001 From: thkim Date: Mon, 24 Nov 2025 15:01:49 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=ED=88=AC=EC=88=98=EA=B3=84=EC=88=98=20?= =?UTF-8?q?=EA=B0=92=EC=9D=B4=20=EC=9E=91=EC=9D=84=20=EB=95=8C=200?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=B2=98=EB=A6=AC=EB=90=98=EB=8A=94=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95=20=EA=B1=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/geoinfo/util/ExcelUtil.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/main/java/geoinfo/util/ExcelUtil.java b/src/main/java/geoinfo/util/ExcelUtil.java index d360938c..7a6ec95c 100644 --- a/src/main/java/geoinfo/util/ExcelUtil.java +++ b/src/main/java/geoinfo/util/ExcelUtil.java @@ -213,6 +213,7 @@ public class ExcelUtil { if(!isOk) { break; } Box obox = new Box(); + /* for(short j=0; j < hbox.size() && j < cells.length; j++) { if(cells[j] == null || cells[j].getContents().trim().equals("")) { continue; } if(cells[j].getType().toString().equals("Date")) { @@ -222,6 +223,26 @@ public class ExcelUtil { obox.put("col"+j, cells[j].getContents().trim()); } } + */ + for(short j=0; j < hbox.size() && j < cells.length; j++) { + if(cells[j] == null || cells[j].getContents().trim().equals("")) { continue; } + + // 1. 숫자 타입(Number) 또는 수식 결과가 숫자인 경우(Number Formula) 체크 + if (cells[j].getType() == jxl.CellType.NUMBER || cells[j].getType() == jxl.CellType.NUMBER_FORMULA) { + jxl.NumberCell nc = (jxl.NumberCell) cells[j]; + // 실제 double 값을 가져와서 문자열로 변환 (지수 표기법 e.g., 2.49E-6 이 될 수 있음) + obox.put("col"+j, String.valueOf(nc.getValue())); + + // 만약 지수 표기법(E) 없이 "0.00000249" 형태를 원한다면 위 줄 대신 아래 주석 코드를 사용하세요. + obox.put("col"+j, new java.math.BigDecimal(nc.getValue()).toPlainString()); + + } else if(cells[j].getType().toString().equals("Date")) { + String val = getDateVal(cells[j]); + obox.put("col"+j, val); + } else { + obox.put("col"+j, cells[j].getContents().trim()); + } + } rsWp.appendRs(obox); } return rsWp;