Merge branch '21128-toolbar-context-menu'
[arvados-workbench2.git] / src / validators / is-number.tsx
index 9b548b948384a500df50134db9c9da888b48ba64..b43eec956cb927f7c9d4058da05479dbbca9e15c 100644 (file)
@@ -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;
 };