Min validator Validates that the value has to be a number and equal to or greater than the min value specified
518647
function(value, attr, minValue, model) {
        if (!isNumber(value) || value < minValue) {
          return this.format(defaultMessages.min, this.formatLabel(attr, model), minValue);
        }
      }
318450
def _range_check(self, value, min_value, max_value):
        '''
        
        '''
        if value < min_value or value > max_value:
            raise ValueError('%s out of range - %s is not between %s and %s' % (self.__class__.__name__, value, min_value, max_value))
1000318
function checkNum(nums, min, max){
  if(nums == null)
    return false;

  if(nums == -1)
    return true;

  for(let i = 0; i < nums.length; i++){
    if(nums[i]<min || nums[i]>max)
      return false;
  }

  return true;
}
1320185
private static <T extends Comparable<T>> void ensureValidRange(T min, T max) {
    if (min == null) {
      throw new InvalidOperationException("Null value for minimum.");
    }
    if (max == null) {
      throw new InvalidOperationException("Null value for maximum.");
    }
    if (min.compareTo(max) >= 0) {
      throw new InvalidOperationException("Invalid range: " + min + " >= " + max);
    }
  }
919979
private void verifyNumber(Number value, Number minimum, Number maximum) {

    if (minimum != null) {
      if (maximum != null) {
        assert ((value.doubleValue() >= minimum.doubleValue()) || (value.doubleValue() <= maximum.doubleValue()));
      } else {
        assert (value.doubleValue() >= minimum.doubleValue());
      }
    } else if (maximum != null) {
      assert (value.doubleValue() <= maximum.doubleValue());
    } else {
      throw new NlsNullPointerException("minimum & maximum");
    }
  }
1278447
function validateValueByRule(accumulator, value, key, property, rule) {
  // If value is not an object, we can't validate it by the rule.
  // A previous validator will have reported this error.
  if (!isObject(value)) {
    return accumulator;
  }

  // property does not exist on value, this is valid
  if (!Object.prototype.hasOwnProperty.call(value, property)) {
    return accumulator;
  }

  const propertyValue = value[property];
  if (propertyValue === undefined) {
    accumulator.errors.push(new Error(`property "${property}" is undefined for key "${key}"`));
    return accumulator;
  }

  switch (rule.type) {
    case 'equal':
      if (
        !isString(propertyValue)
        && !isNumber(propertyValue)
        && !isBoolean(propertyValue)
      ) {
        accumulator.errors.push(new Error(`equal property "${property}" must be a string, number, or boolean for key "${key}"`));
      }
      break;
    case 'list':
      if (!Array.isArray(propertyValue)) {
        accumulator.errors.push(new Error(`list property "${property}" must be an array for key "${key}"`));
        return accumulator;
      }
      propertyValue.forEach((listValue) => {
        if (
          !isString(listValue)
          && !isNumber(listValue)
          && !isBoolean(listValue)
        ) {
          accumulator.errors.push(new Error(`values in list property "${property}" must be a string, number, or boolean for key "${key}"`));
        }
      });
      break;
    case 'percent':
      if (
        !isNumber(propertyValue)
        || propertyValue > 100
        || propertyValue < 0
      ) {
        accumulator.errors.push(new Error(`percent property "${property}" must be a number between 0 and 100 inclusive for key "${key}"`));
      } else {
        accumulator.percentTotal += propertyValue;
      }
      break;
    /* eslint default-case: 0 */
  }

  return accumulator;
}
908602
def gte(min_value):
    
    def validate(value):
        if value < min_value:
            return e("{} is not greater than or equal to {}", value, min_value)
    return validate
1295288
function (value, min, max) {
        value = parseInt(value, 10);
        min = min | 0;
        if (isNaN(value) || value < min) {
            return false;
        }
        if (max && value > max) {
            return false;
        }
        return true;
    }
379751
protected function _validator_minlength($input, $value, $min) {
		if (!is_string($value)) return false;
		if (strlen($value) < $min) return false;
		return true;
	}
207130
function minValue(bound, formatError) {
        'use strict';
        return function (value) {
            if (value || !isNaN(parseFloat(value))) {
                var intValue = Number(value);
                if (!isNaN(intValue) && intValue < bound) {
                    return formatError(intValue);
                }
            }
            return '';
        };
    }
219400
def validate_equal(value):
    
    def equal_validator(field, data):
        if field.value is None:
            return
        if not (field.value == value):
            raise ValidationError('equal', other=value)
    return equal_validator
1056241
def validate(self, value):
        """"""
        if self.type is not None:
            value = coerce(self.type, value)

        if self.min is not None and value < self.min:
            raise ValueError('%s=%s is less than %s' % (self.name, value,
                                                        self.min))
        if self.max is not None and value > self.max:
            raise ValueError('%s=%s is greater than %s' % (
                self.name, value, self.max))
        if self.allowed is not None and value not in self.allowed:
            raise ValueError('%s=%s is not one of the allowed values: %s' % (
                self.name, value, ','.join(map(str, self.allowed))))

        return value
1214030
private static function validateRange($value, $min, $max)
	    {
	        $res = filter_var($value, FILTER_VALIDATE_INT, array(
	            'options' => array('min_range' => $min, 'max_range' => $max)
	        ));
	        if (false === $res) {
	            throw new OutOfRangeException("the submitted value is not contained within the valid range");
	        }

	        return $res;
	    }
48386
def validate_number_attribute(
        fully_qualified_name: str,
        spec: Dict[str, Any],
        attribute: str,
        value_type: Union[Type[int], Type[float]] = int,
        minimum: Optional[Union[int, float]] = None,
        maximum: Optional[Union[int, float]] = None) -> Optional[InvalidNumberError]:
    

    if attribute not in spec:
        return

    try:
        value = value_type(spec[attribute])
        if (minimum is not None and value < minimum) or (maximum is not None and value > maximum):
            raise None
    except:
        return InvalidNumberError(fully_qualified_name, spec, attribute, value_type, minimum,
                                  maximum)
671808
def validate_range_value(value):
    
    if value == (None, None):
        return

    if not hasattr(value, '__iter__'):
        raise TypeError('Range value must be an iterable, got "%s".' % value)
    if not 2 == len(value):
        raise ValueError('Range value must consist of two elements, got %d.' %
                         len(value))
    if not all(isinstance(x, (int,float)) for x in value):
        raise TypeError('Range value must consist of two numbers, got "%s" '
                        'and "%s" instead.' % value)
    if not value[0] <= value[1]:
        raise ValueError('Range must consist of min and max values (min <= '
                         'max) but got "%s" and "%s" instead.' % value)
    return
243260
public function _validation_numeric_min($val, $min_val)
	{
		return $this->_empty($val) || floatval($val) >= floatval($min_val);
	}
678449
def set_minmax(field, render_kw=None, force=False):
    
    if render_kw is None:
        render_kw = {}
    for validator in field.validators:
        if isinstance(validator, MINMAX_VALIDATORS):
            if 'min' not in render_kw or force:
                v_min = getattr(validator, 'min', -1)
                if v_min not in (-1, None):
                    render_kw['min'] = v_min
            if 'max' not in render_kw or force:
                v_max = getattr(validator, 'max', -1)
                if v_max not in (-1, None):
                    render_kw['max'] = v_max
    return render_kw