2

I am developing a German app and they do not use dots (20.00) in numbers, they use commas (20,00). Using react-hook-form, how do I replace the dot without converting my numbers to strings?

NumberInput is imported

<NumberInput
   id={item.field}
   errorMessage={t(
       get(errors, `${item.group}.${item.field}`)?.message
   )}
   decimalPlaces={item.decimalPlaces}
   controllerProps={{
   name: `${item.group}.${item.field}`,
   control: control,
      rules: {
      ...item.rules,
      validate: {
         oneRequired: (v) =>
             validateOneRequired(v, item?.validateAgainst)
      }
    }
  }}
inputcss={`w-formTextInput ${
errors?.[item.group]?.[item.field] && 'border-red-600'
}`}
enableTooltip={item.enableTooltip}
tooltip={item.tooltip}
key={index}
label={item.placeHolder}
placeholder={item.placeHolder}
/>

jonson.ncube
  • 226
  • 2
  • 16

0 Answers0