fix(view): round the lengths shown in the 재료표 and in the Excel rows to 0.1 mm

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 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-10-23 15:54:17 +09:00
1 parent 65c53f2b5d
commit e580677887
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -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)]);
}
+1 -1
View File
@@ -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;