diff --git a/assets/admin/components/inventory/AddItemModal.tsx b/assets/admin/components/inventory/AddItemModal.tsx index cb0a591e..a707ffcc 100644 --- a/assets/admin/components/inventory/AddItemModal.tsx +++ b/assets/admin/components/inventory/AddItemModal.tsx @@ -23,6 +23,8 @@ interface FormState { const BLANK: FormState = { name: '', consumable: '', unit: '', price: '', stock: '', alertThreshold: '' }; const digits = (v: string) => toEnglishDigits(v).replace(/\D/g, ''); +// group thousands: "1200000" → "1,200,000" +const group = (v: string) => v.replace(/\B(?=(\d{3})+(?!\d))/g, ','); /** «افزودن/ویرایش کالای جدید» — mirrors tauri ModalAddInventory field-for-field. */ export default function AddItemModal({ open, editing, saving, onClose, onSave }: Props) { @@ -79,7 +81,7 @@ export default function AddItemModal({ open, editing, saving, onClose, onSave }: