// 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;
};