mirror of
https://github.com/status-im/safe-react.git
synced 2025-03-01 09:50:43 +00:00
use parseFloat in maxValue validator so it works for numbers between 0 and 1 and respects decimals
This commit is contained in:
parent
6624126bd9
commit
147c235f7b
@ -50,8 +50,8 @@ export const minValue = (min: number) => (value: string) => {
|
||||
return `Should be at least ${min}`
|
||||
}
|
||||
|
||||
export const maxValue = (max: number) => (value: string) => {
|
||||
if (Number.isNaN(Number(value)) || Number.parseInt(value, 10) <= Number(max)) {
|
||||
export const maxValue = (max: number | string) => (value: string) => {
|
||||
if (Number.isNaN(Number(value)) || parseFloat(value, 10) <= parseFloat(max, 10)) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user