[ST] - 컬럼 자동 계산식 오류 수정

This commit is contained in:
2026-08-24 16:39:24 +09:00
parent 23424b5eee
commit 6dd09971f1
5 changed files with 7 additions and 9 deletions
@@ -308,6 +308,7 @@ const CompactDataGrid = ({
if (fixedColumns !== undefined && fixedColumns > 0) {
gridView.setFixedOptions({
colCount: fixedColumns,
resizable: true,
});
}
@@ -1688,6 +1688,7 @@ useEffect(() => {
if (fixedColumns !== undefined && fixedColumns > 0) {
gridView.setFixedOptions({
colCount: fixedColumns,
resizable: true,
});
}
@@ -1232,6 +1232,7 @@ const TabDataGrid = ({
if (currentInfo.fixedColumns !== undefined && currentInfo.fixedColumns > 0) {
gridView.setFixedOptions({
colCount: currentInfo.fixedColumns,
resizable: true,
});
}
@@ -9,11 +9,6 @@ import {
footerIntArrayByDivision,
} from "@/components/util/grid/footerSummary";
const currentYear = dayjs().year() - 1;
const startYear = 1996;
const totalCount = currentYear - startYear + 1;
// 하수도 통계 관리 02. 하수관로
const rawList = [
{
@@ -19,14 +19,14 @@ const SUM_DECIMAL_SCALE = 1e6;
/**
* 스케일 정수 합을 Number로 되돌릴 때 생기는 IEEE 오차 보정.
* 예: 9003630000/1e6 → 9003.62999… (RealGrid trunc 시 9003.62)
* 아주 작은 양수를 더해 표시가 9003.63이 되게 한다.
* 39057.34는 이진수로 39057.33999… 가 되어 RealGrid `#,##0.00` 절사 시 39057.33이 된다.
* 1e-12는 이 값에서 *100 경계를 넘지 못하므로, 값 크기에 비례한 ULP만큼 밀어 올린다.
*/
function numberFromScaledSum(scaledSum: number): number {
if (scaledSum === 0) return 0;
const raw = scaledSum / SUM_DECIMAL_SCALE;
if (scaledSum % SUM_DECIMAL_SCALE === 0) return raw;
return raw + Math.sign(raw) * 1e-12;
const ulp = Number.EPSILON * Math.max(1, Math.abs(raw));
return raw + Math.sign(raw) * ulp * 8;
}
/**