X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/428d454e2681d66bb14558946cfe2fb77a2c8dce..1bbdd9c70d0099e0bf46b3c1ac55e423e3406314:/src/validators/is-number.tsx diff --git a/src/validators/is-number.tsx b/src/validators/is-number.tsx index 9b548b9483..b43eec956c 100644 --- a/src/validators/is-number.tsx +++ b/src/validators/is-number.tsx @@ -3,8 +3,8 @@ // SPDX-License-Identifier: AGPL-3.0 import { isNumber as isNum } from 'lodash'; -const ERROR_MESSAGE = 'This field must be a number'; +const ERROR_MESSAGE = 'This field can only contain numeric values'; export const isNumber = (value: any) => { - return isNum(value) ? undefined : ERROR_MESSAGE; + return !isNaN(value) && isNum(value) ? undefined : ERROR_MESSAGE; };