Merge pull request #221 from gnosis/bug/205-max-value-validator-doesnt-work

BUG 205: Max value validator doesn't work when entering tx value
This commit is contained in:
Mikhail Mikheev 2019-10-15 15:05:18 +04:00 committed by GitHub
commit 102a22418c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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
}