Skip to content

Commit

Permalink
feat: update regex
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslav-klimuk authored Sep 24, 2024
1 parent baff6c2 commit dc79248
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/ui/currency-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const CurrencyInput: FC<CurrencyInputProps> = ({
let newValue = event.target.value
newValue = newValue.replace(',', '.')

if (newValue === "" || /^\d*\.?\d*$/.test(newValue)) {
if (newValue === "" || /^\d+\.?\d*$/.test(newValue)) {
if (onChange) {
event.target.value = newValue
onChange(event)
Expand Down

0 comments on commit dc79248

Please sign in to comment.