fix(m01): 흐름 합계 끝수 = 비용 출력 상자에 실린 로직 자신의 끝수 · 새 로직만 기본 1원 미만 버림

왼쪽 흐름 보기 소계 · 계와 오른쪽 원가 합계가 같은 끝수를 씀(Round.totalRoundOf)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EauA2ATmqNRbeV48s9CcBr
This commit is contained in:
2026-10-02 00:34:17 +09:00
co-authored by Claude Sonnet 5.5
parent fa33abb5f0
commit a5edf43d6e
4 changed files with 70 additions and 9 deletions
@@ -107,3 +107,15 @@ export function showRounded(v: number, r?: CfRound): string {
let totalNow: CfRound = { places: 0, method: "버림" };
void defaultTotalRound().then((r) => (totalNow = r));
export const totalRoundNow = (): CfRound => totalNow;
/** 그 로직의 합계 끝수 — 비용 출력 상자에 끝수가 실려 있으면 그것(옛 로직을 옮긴 흐름은 자신의 끝수) ·
* 없으면 기본(새 로직 = 일위대가표 계금 1원 미만 버림) */
export function totalRoundOf(
lg: { boxes: { kind: string; output?: { cost: string; round?: CfRound } }[] },
fallback: CfRound,
): CfRound {
const hit = lg.boxes.find(
(b) => b.kind === "output" && b.output?.cost !== "값" && b.output?.round,
);
return hit?.output?.round ?? fallback;
}