diff --git a/src/utils/validators.js b/src/utils/validators.js index 0cfcf9b0..c44bebac 100644 --- a/src/utils/validators.js +++ b/src/utils/validators.js @@ -85,7 +85,7 @@ module.exports = { double(value, field) { let res = checkEmpty(value, field.required); if (res != null) return res; - if (!(Number(value) === value && value % 1 !== 0)) + if (!isNumber(value) || isNaN(value)) return [msg(resources.invalidNumber)]; }, @@ -227,4 +227,4 @@ module.exports = { if (!re.test(value)) return [msg(resources.invalidTextContainSpec)]; } -}; \ No newline at end of file +};