fix(spreadsheet): 회계 0 구역 '?' 자리 빈칸 처리 · 통화 로캘 태그 대조 확인

브레인이 짐작한 [$-412](로캘만 · 기호 없음) 이 통화 기호로 잘못 바뀌는지
여러 실제 꼴(단순 태그·회계 네 구역·접두/접미 위치)로 대조해 봤으나 지금
코드는 이미 옳게 기호를 안 보임(회귀 시험으로 고정). 그 김에 회계 0 구역의
`"-"??` 관용구가 진짜 0 값에서 정수부 `?` 를 「0」 으로 채우던 것을 고쳐
엑셀처럼 빈칸으로 보이게 함. 사용자가 보고한 ₩ 는 이 두 경로로는 재현이
안 돼 — main_desktop_1 의 fixture_excel_user_won.html 이 아직 안 와서
실제 원문으로는 대조 못 함(오면 바로 대조).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RrQ65VtGZbae2VKgYVMhmc
This commit is contained in:
2026-09-28 13:15:24 +09:00
co-authored by Claude Sonnet 5
parent b813de897f
commit c4edc751be
2 changed files with 15 additions and 1 deletions
+5 -1
View File
@@ -185,7 +185,11 @@ function renderNumericSection(toks: Tok[], magnitude: Frac): string {
const rawFracStr = fracDigitToks.length > 0 ? allDigits.slice(-fracDigitToks.length) : "";
let intStr = rawIntStr;
if (intDigitToks.length > intStr.length) {
// 정수부가 온통 `?`(회계 형식 0 구역의 `"-"??` 자리맞춤 버릇)뿐이고 값이 정말 0 이면
// 자리마다 빈칸(엑셀은 `?` 를 「있으면 숫자 · 없으면 빈칸」으로 봄 — `0` 처럼 0 을 안 채움).
if (intDigitToks.length > 0 && rawIntStr === "0" && intDigitToks.every((t) => t.ch === "?")) {
intStr = " ".repeat(intDigitToks.length);
} else if (intDigitToks.length > intStr.length) {
const need = intDigitToks.length - intStr.length;
let pad = "";
for (let i = 0; i < need; i++) pad += intDigitToks[i].ch === "0" ? "0" : "";