dom-validator
Version:
Validator similar to vee-validator for vuetify Applications
11 lines (8 loc) • 340 B
JavaScript
import {parseFloatLocale} from '../utilities/number'
export default (value, max, scope, otherComponentsInScope, validator, fieldName, locale) => {
max = parseInt(max)
if (Array.isArray(value) || value === null || value === undefined || value === '') {
return false;
}
return Number(parseFloatLocale(value, locale)) <= max;
};