feat: 修正 BOM 單位顯示與完工入庫彈窗 UI 統一規範

This commit is contained in:
2026-02-12 16:30:34 +08:00
parent eb5ab58093
commit 5be4d49679
20 changed files with 1186 additions and 549 deletions

View File

@@ -4,3 +4,10 @@ import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
export function formatQuantity(value: number | string): string {
const num = typeof value === 'string' ? parseFloat(value) : value;
if (isNaN(num)) return '0';
// 使用 Number() 會自動去除末尾無意義的 0
return String(Number(num.toFixed(4)));
}