diff --git a/src/components/pages/production/recording/form/RecordingForm.tsx b/src/components/pages/production/recording/form/RecordingForm.tsx index 2735a7e9..120cddb8 100644 --- a/src/components/pages/production/recording/form/RecordingForm.tsx +++ b/src/components/pages/production/recording/form/RecordingForm.tsx @@ -487,7 +487,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { // Create wrapper handlers that match NumberInput's onChange signature const handleChickenWeightChangeWrapper = useCallback( (idx: number) => (e: React.ChangeEvent) => { - const value = parseFloat(e.target.value) || 0; + const value = parseFloat(e.target.value.replace(/[^\d,.-]/g, '').replace(/,/g, '')) || 0; handleChickenWeightChange(idx, value); }, [handleChickenWeightChange] @@ -495,7 +495,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { const handleChickenCountChangeWrapper = useCallback( (idx: number) => (e: React.ChangeEvent) => { - const value = parseFloat(e.target.value) || 0; + const value = parseFloat(e.target.value.replace(/[^\d,.-]/g, '').replace(/,/g, '')) || 0; handleChickenCountChange(idx, value); }, [handleChickenCountChange] @@ -503,7 +503,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { const handleAverageWeightChangeWrapper = useCallback( (idx: number) => (e: React.ChangeEvent) => { - const value = parseFloat(e.target.value) || 0; + const value = parseFloat(e.target.value.replace(/[^\d,.-]/g, '').replace(/,/g, '')) || 0; handleAverageWeightChange(idx, value); }, [handleAverageWeightChange] @@ -1100,8 +1100,10 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { onBlur={formik.handleBlur} maskType='weight' weightUnit='gram' - decimals={0} + decimals={2} min={0} + thousandSeparator=',' + decimalSeparator='.' isError={ isRepeaterInputError( 'body_weight', @@ -1162,8 +1164,10 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { onBlur={formik.handleBlur} maskType='weight' weightUnit='gram' - decimals={0} + decimals={2} min={0} + thousandSeparator=',' + decimalSeparator='.' isError={ isRepeaterInputError( 'body_weight',