This commit is contained in:
2026-10-20 15:48:27 +08:00
parent 489b1bcd16
commit db32f31cc2
67 changed files with 1262 additions and 71 deletions
@@ -188,8 +188,8 @@ function optionalText(value: string) {
return value.trim() || null
}
function formatWeight(value: number | string | null) {
if (value === null || value === '') return '—'
function formatWeight(value: number | string | null | undefined) {
if (value == null || value === '') return '—'
const numeric = Number(value)
return Number.isFinite(numeric) ? `${numeric.toLocaleString('zh-CN', { maximumFractionDigits: 3 })} kg` : `${value} kg`
}