fix: TableListComponent에서 숫자 타입 컬럼 천 단위 콤마 표시
- inputType이 number 또는 decimal인 컬럼에 천 단위 콤마 자동 적용 - 문자열로 저장된 숫자도 parseFloat 후 포맷팅 처리 - format 속성보다 inputType을 우선 체크하도록 수정
This commit is contained in:
@@ -647,6 +647,17 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
||||
if (convertedValue !== value) return convertedValue;
|
||||
}
|
||||
|
||||
// inputType 기반 포맷팅 (우선순위)
|
||||
if (column.inputType === "number" || column.inputType === "decimal") {
|
||||
if (value !== null && value !== undefined && value !== "") {
|
||||
const numValue = typeof value === "string" ? parseFloat(value) : value;
|
||||
if (!isNaN(numValue)) {
|
||||
return numValue.toLocaleString("ko-KR");
|
||||
}
|
||||
}
|
||||
return String(value);
|
||||
}
|
||||
|
||||
switch (column.format) {
|
||||
case "date":
|
||||
if (value) {
|
||||
|
||||
Reference in New Issue
Block a user