diff options
| author | joonhoekim <26rote@gmail.com> | 2025-11-02 18:15:09 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-11-02 18:15:09 +0900 |
| commit | 12cbc70c65a8588b85af3d90b527e16a0a9f8e21 (patch) | |
| tree | e32502988f90e5d1a38b2a6816c146cc01288b9c /components/contract/contract-items-card.tsx | |
| parent | 503ff56f5471818472eeb44b74cb35c4f977e6d1 (diff) | |
(김준회) 공통: 숫자 , 구분 (3자리) 공통함수 추가 및 PO 금액 컬럼들에 적용, currency 정보에 따라 표기하도록 분기 처리
Diffstat (limited to 'components/contract/contract-items-card.tsx')
| -rw-r--r-- | components/contract/contract-items-card.tsx | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/components/contract/contract-items-card.tsx b/components/contract/contract-items-card.tsx index 0d43f979..5bf5a927 100644 --- a/components/contract/contract-items-card.tsx +++ b/components/contract/contract-items-card.tsx @@ -1,5 +1,5 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" -import { formatCurrency } from "@/lib/utils" +import { formatCurrency, formatNumber } from "@/lib/utils" interface ContractItem { materialNo?: string @@ -13,10 +13,10 @@ interface ContractItem { interface ContractItemsCardProps { items: ContractItem[] - currency?: string + currency?: string | null } -export function ContractItemsCard({ items, currency = "KRW" }: ContractItemsCardProps) { +export function ContractItemsCard({ items, currency }: ContractItemsCardProps) { if (!items || items.length === 0) { return null } @@ -50,18 +50,22 @@ export function ContractItemsCard({ items, currency = "KRW" }: ContractItemsCard </td> <td className="px-4 py-3 text-right font-mono"> {item.unitPrice - ? formatCurrency( - parseFloat(item.unitPrice.toString()), - currency - ) + ? currency + ? formatCurrency( + parseFloat(item.unitPrice.toString()), + currency + ) + : formatNumber(parseFloat(item.unitPrice.toString())) : "-"} </td> <td className="px-4 py-3 text-right font-mono font-medium"> {item.contractAmount - ? formatCurrency( - parseFloat(item.contractAmount.toString()), - currency - ) + ? currency + ? formatCurrency( + parseFloat(item.contractAmount.toString()), + currency + ) + : formatNumber(parseFloat(item.contractAmount.toString())) : "-"} </td> </tr> |
