wip(est-test): 개발 중 저장 3 — 깃 싱크(11-08)

This commit is contained in:
2026-11-08 17:44:13 +09:00
parent d39eece45e
commit db71cdbf7c
28 changed files with 1027 additions and 202 deletions
+5 -1
View File
@@ -1,7 +1,7 @@
// REA TFRMCONVERTTOGANGUB (0xf616f0, 0xf61888)
// 자재단가(StuffcDat) 부가세 계산: 포함(*1.1) / 제외(/1.1) 및 단단위 자릿수(사사오입/절하/절상) 처리
const EstVat = (() => {
const { num, fixed } = EstMath;
const { num, fixed, even } = EstMath;
// REA radCalcMethod: 0 = 부가세포함(×1.1), 1 = 부가세제외(÷1.1)
// REA radDigetIndex: 0 = 사사오입(1), 1 = 절하(2), 2 = 절상(3)
@@ -16,6 +16,10 @@ const EstVat = (() => {
// REA 관례: 0이면 원단위(0), n > 0이면 10^n 미만(-n) 또는 소수점
// 일반적으로 단단위계산에서 spnDiget은 자리수를 나타냄. 0이면 정수 원단위(0), n이면 -n 단위 절하/사사오입/절상.
const digits = -Math.max(0, Math.trunc(num(diget)));
if (digetMethod === 2) {
const step = 10 ** -digits;
return Math.ceil(even(scaled * 10000) / 10000 / step) * step;
}
const m = methodMap[digetMethod] ?? 2;
return fixed(scaled, digits, m);
}