From 32a3987895f12180fab20b1416ba3a57910374fd Mon Sep 17 00:00:00 2001 From: pro Date: Fri, 23 Jan 2026 16:09:31 +0900 Subject: [PATCH] =?UTF-8?q?fix:=EB=B6=84=EA=B0=9C=20=EB=AA=A8=EB=8B=AC=20?= =?UTF-8?q?=EA=B8=88=EC=95=A1=20=EC=9E=85=EB=A0=A5=EC=97=90=20=EC=9E=90?= =?UTF-8?q?=EB=8F=99=20=EC=BD=A4=EB=A7=88=20=ED=8F=AC=EB=A7=B7=ED=8C=85=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 금액 입력 시 3자리마다 콤마 자동 추가 - type="number" → type="text"로 변경 - 금액 우측 정렬 (text-right) - formatAmountInput/parseAmountInput 헬퍼 함수 추가 Co-Authored-By: Claude Opus 4.5 --- .../views/barobill/ecard/index.blade.php | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/resources/views/barobill/ecard/index.blade.php b/resources/views/barobill/ecard/index.blade.php index d63acff0..f4563d8e 100644 --- a/resources/views/barobill/ecard/index.blade.php +++ b/resources/views/barobill/ecard/index.blade.php @@ -366,6 +366,18 @@ className={`px-3 py-1.5 text-xs cursor-pointer hover:bg-purple-50 ${ const formatCurrency = (val) => new Intl.NumberFormat('ko-KR').format(val || 0); + // 금액 입력 포맷팅 (콤마 추가) + const formatAmountInput = (value) => { + if (!value && value !== 0) return ''; + return new Intl.NumberFormat('ko-KR').format(value); + }; + + // 금액 입력값 파싱 (콤마 제거) + const parseAmountInput = (value) => { + const cleaned = String(value).replace(/[^0-9.-]/g, ''); + return parseFloat(cleaned) || 0; + }; + return (
@@ -402,10 +414,11 @@ className={`px-3 py-1.5 text-xs cursor-pointer hover:bg-purple-50 ${
updateSplit(index, { amount: parseFloat(e.target.value) || 0 })} - className="w-full px-3 py-2 border border-stone-200 rounded-lg text-sm focus:ring-2 focus:ring-purple-500 outline-none" + type="text" + value={formatAmountInput(split.amount)} + onChange={(e) => updateSplit(index, { amount: parseAmountInput(e.target.value) })} + className="w-full px-3 py-2 border border-stone-200 rounded-lg text-sm text-right focus:ring-2 focus:ring-purple-500 outline-none" + placeholder="0" />