From 237218194009b76ab6c93c49e48cbd1f26e42fbb Mon Sep 17 00:00:00 2001 From: umsangdon Date: Mon, 2 Nov 2026 23:18:35 +0900 Subject: [PATCH] =?UTF-8?q?refactor(751-2):=20=EB=B6=88=EB=9F=AC=EC=98=A4?= =?UTF-8?q?=EA=B8=B0=20=ED=99=94=EB=A9=B4=20=EC=A7=81=EC=A0=91=20=EA=BC=B4?= =?UTF-8?q?=20=EA=B0=88=EC=9D=8C=20=E2=80=94=20CheckRows=20=EC=88=98?= =?UTF-8?q?=EB=9F=89=20=C2=B7=20Compare=20=EC=88=98=EB=9F=89=20=C2=B7=20?= =?UTF-8?q?=ED=9B=84=EB=B3=B4=20=EB=8B=A8=EA=B0=80=20=EA=B3=B5=EC=9A=A9=20?= =?UTF-8?q?=EA=BC=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- M02_MasterTemplete/M02_MasterTemplete_Hopyo_CheckRows.ts | 5 ++--- M02_MasterTemplete/M02_MasterTemplete_Hopyo_Compare.ts | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_CheckRows.ts b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_CheckRows.ts index 8b90df4f8..35dee7c48 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_CheckRows.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_CheckRows.ts @@ -26,7 +26,7 @@ import type { LaborCalc } from "./M02_MasterTemplete_Labor_Api"; import { markCells, markHeads } from "./M02_MasterTemplete_Labor_MatMarks"; import { moneyCell, PRICE_SLOTS } from "./M02_MasterTemplete_Labor_Rows"; import { tc } from "./M02_MasterTemplete_Labor_Text"; -import { formatPrice } from "../common_util/common_util_money"; +import { formatNumber, formatPrice } from "../common_util/common_util_money"; import { tableOf } from "./logic/M02_MasterTemplete_Hopyo_Draft"; /** 드롭다운 — 저장 값(서버 뺌 까닭) → 화면 글 */ @@ -62,8 +62,7 @@ export interface RowsContext { options: (line: HopyoLine, at: number) => void; } -const num = (v: number): string => - Number(v.toPrecision(12)).toLocaleString("ko-KR", { maximumFractionDigits: 6 }); +const num = formatNumber; const small = (text: string, cls = "m02-labrow__note"): HTMLElement => el("small", { className: cls, text, attrs: { title: text } }); diff --git a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_Compare.ts b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_Compare.ts index 80426135e..827e5cdf5 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_Compare.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_Compare.ts @@ -12,6 +12,7 @@ import { t as L, type LocaleKey } from "@ui/ui_template_locale"; import { createSegment } from "@ui/ui_template_segment"; import { createTable } from "@ui/ui_template_table"; import { createText } from "@ui/ui_template_text"; +import { formatNumber, formatPrice } from "../common_util/common_util_money"; import type { CompareLook, ElemCand, @@ -26,7 +27,7 @@ const LOOK: Record = { 기초만: { tone: "neutral", key: "M02_CmpBase" }, }; const LOOKS = Object.keys(LOOK) as CompareLook[]; -const num = (n: number | null): string => (n === null ? "—" : String(Number(n.toPrecision(4)))); +const num = (n: number | null): string => (n === null ? "—" : formatNumber(n)); /** 선택 칸 글 뒤 요약 — 「같음 3 · 품 다름 1」 · 견줌 못함 = "" */ export const compareBrief = (c: SangeunCompare | null | undefined): string => @@ -112,7 +113,7 @@ export function elemChoices(cands: ElemCand[], pick: (c: ElemCand) => void): HTM const box = el("div", { className: "ui-toolbar", attrs: { "data-elem": "" } }); box.title = L("M02_ElemTitle"); for (const c of cands.slice(0, 3)) { - const price = c.단가 ? ` · ${c.단가.toLocaleString()}` : ""; + const price = c.단가 ? ` · ${formatPrice(c.단가)}` : ""; const b = createButton({ label: `${c.이름}${c.규격 ? ` ${c.규격}` : ""} [${c.단위 ?? ""}]${price}`, size: 24,