fix(SAM/react): 할인액/할인율 표시 포맷 수정

- 할인액 0원일 때 -0원 → 0원으로 표시
- 할인율 소수점 있을 시 반올림 처리 (0.00% → 0%)
This commit is contained in:
2026-01-26 14:13:41 +09:00
parent 80f5ed426c
commit a197800d2f
2 changed files with 27 additions and 6 deletions

View File

@@ -207,11 +207,11 @@ export function ContractDocument({
<td className="p-2 bg-gray-100 border-r border-gray-300 w-32"></td>
<td className="p-2 text-right border-r border-gray-300">{formatAmount(subtotal)}</td>
<td className="p-2 bg-gray-100 border-r border-gray-300 w-32"></td>
<td className="p-2 text-right">{discountRate}%</td>
<td className="p-2 text-right">{Number.isInteger(discountRate) ? discountRate : Math.round(discountRate)}%</td>
</tr>
<tr className="border-b border-gray-300">
<td className="p-2 bg-gray-100 border-r border-gray-300"></td>
<td className="p-2 text-right border-r border-gray-300 text-red-600">-{formatAmount(discountAmount)}</td>
<td className="p-2 text-right border-r border-gray-300 text-red-600">{discountAmount > 0 ? `-${formatAmount(discountAmount)}` : formatAmount(discountAmount)}</td>
<td className="p-2 bg-gray-100 border-r border-gray-300"> </td>
<td className="p-2 text-right">{formatAmount(afterDiscount)}</td>
</tr>