Files
Aislo/resources/tester/spreadsheet/spreadsheet_numfmt_survey_entry.ts
T
eomsangdonandClaude Sonnet 5 b93e03e505 feat(spreadsheet): fill.ts를 A 엔진 실 구현으로 잇기 · numfmt 실무 서식 대조 고침
fill.ts가 A의 실제 moveFormula·toA1을 쓰도록 정리(식 채우기 시험 통과).
실무 구조도 xlsx 세 벌 실측 형식 코드 66개 대조 — `_x` trailing 공백을 trim이 삼키던 버그,
글 값에 순수 수 형식이 적용되던 버그, `General"단위"` 접미 버릇, `[$통화-로캘]` 태그 미지원을 고침.
분수 형식(`0/0`)은 1단계 형식 부분집합 밖이라 남겨둠. 회귀 시험 추가.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RrQ65VtGZbae2VKgYVMhmc
2026-09-27 20:39:03 +09:00

44 lines
1.4 KiB
TypeScript

/* =============================================================================
* spreadsheet_numfmt_survey_entry.ts (B 자기 시험)
* 실무 구조도 xlsx 세 벌에서 뽑은 실제 숫자 형식 코드 전부를 numfmt 로 돌려 사람이 대조.
* 입력 = 시험이 openpyxl 로 미리 뽑은 JSON(코드 · 실측 수 · 실측 글 견본).
* ========================================================================== */
import { readFileSync } from "node:fs";
import { toFrac } from "@ui/sheet/ui_template_sheet_frac";
import { formatValue } from "../../../A00_Common/spreadsheet/spreadsheet_numfmt";
interface CodeSample {
code: string;
count: number;
num: number | null;
str: string | null;
}
const inputPath = process.argv[2];
const samples: CodeSample[] = JSON.parse(readFileSync(inputPath, "utf-8"));
const rows = samples.map((s) => {
let numOut: string | null = null;
let numErr: string | null = null;
if (s.num !== null) {
try {
numOut = formatValue(toFrac(s.num), s.code).글;
} catch (e) {
numErr = String(e);
}
}
let strOut: string | null = null;
let strErr: string | null = null;
if (s.str !== null) {
try {
strOut = formatValue(s.str, s.code).글;
} catch (e) {
strErr = String(e);
}
}
return { ...s, numOut, numErr, strOut, strErr };
});
console.log(JSON.stringify(rows, null, 1));