From e580677887236c7b9585181bdaf4ef9fa38cb330 Mon Sep 17 00:00:00 2001 From: ypshim Date: Fri, 23 Oct 2026 15:54:17 +0900 Subject: [PATCH] =?UTF-8?q?fix(view):=20round=20the=20lengths=20shown=20in?= =?UTF-8?q?=20the=20=EC=9E=AC=EB=A3=8C=ED=91=9C=20and=20in=20the=20Excel?= =?UTF-8?q?=20rows=20to=200.1=20mm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Single-piece lengths such as the B9 and C7 pieces showed long unrounded decimals (2128.1174619702915). They are rounded to 0.1 mm for display and in the Excel rows; the totals are unchanged. Co-Authored-By: Claude Haiku 5.5 --- src/core/rebar/quantity.ts | 2 +- src/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/rebar/quantity.ts b/src/core/rebar/quantity.ts index 3bd50aa..380137c 100644 --- a/src/core/rebar/quantity.ts +++ b/src/core/rebar/quantity.ts @@ -113,7 +113,7 @@ export function quantityRows(q: Quantity): (string | number)[][] { for (const g of q.groups) { for (const d of g.diameters) { for (const l of d.lines) { - out.push([`SD${g.grade}`, l.name, l.shape, l.size, l.count, l.length ?? '여러 길이', round(l.totalM), round(l.kgPerM, 3), round(l.kg)]); + out.push([`SD${g.grade}`, l.name, l.shape, l.size, l.count, l.length === null ? '여러 길이' : round(l.length), round(l.totalM), round(l.kgPerM, 3), round(l.kg)]); } out.push(['', `${d.size} 소계`, '', d.size, '', '', round(d.totalM), '', round(d.kg)]); } diff --git a/src/main.ts b/src/main.ts index f39eb9b..dcc99a0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1058,7 +1058,7 @@ function quantityTargets(): Pier[] { /** Length cell of a 재료표 line: the length, or 여러 길이 with the pieces on hover. */ function lengthCell(l: QuantityLine): HTMLTableCellElement { - if (l.length !== null) return el('td', String(l.length)); + if (l.length !== null) return el('td', String(Math.round(l.length * 10) / 10)); const cell = el('td', `여러 길이 (${l.pieces.length}종)`); cell.title = l.pieces.map((p) => `${Math.round(p.length)} × ${p.count}`).join(' · '); return cell;