feat: 修正 BOM 單位顯示與完工入庫彈窗 UI 統一規範
This commit is contained in:
@@ -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)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user