Number Rules
Numberic
check if the value is a number or not, it can be integer, float, or string can be convert to integer or float.
Parameters:
- message (str, optional): The error message to be used if the validation fails.
Example
GreaterThenOrEqual
Validator to check if a value is greater than or equal a specified threshold.
GreaterThenOrEqual
has an alias Gte
.
Parameters:
- threshold (float): The threshold value that the input value must exceed.
- message (str,optional): The error message to be used if the validation fails.
Example
GreaterThen
Validator to check if a value is greater than a specified threshold.
GreaterThen
has an alias Gt
.
Parameters:
- threshold (float): The threshold value that the input value must exceed.
- message (str,optional): The error message to be used if the validation fails.
Example
LessThenOrEqual
Validator to check if a value is less than or equal a specified threshold.
LessThenOrEqual
has an alias Lte
.
Parameters:
- threshold (float): The threshold value that the input value must exceed.
- message (str,optional): The error message to be used if the validation fails.
Example
LessThen
Validator to check if a value is less than a specified threshold.
LessThen
has an alias Lt
.
Parameters:
- threshold (float): The threshold value that the input value must exceed.
- message (str, optional): The error message to be used if the validation fails.
Example
NumberRange
Validate to check if a value is has number between min and max
Parameters:
- min (int|float): The minimum number allowed.
- max (int|float): The maximum number allowed.
- message (str, optional): The error message to be used if the validation fails.
Example
DecimalRange
Validate to check if a value is has decimal between min and max
Parameters:
- min (int): The minimum number of decimal places allowed.
- max (int): The maximum number of decimal places allowed.
- message (str): The error message to be used if the validation fails.
DigitsBetween
Validator to check if a value has a length between a specified minimum and maximum.
Check by: if length < min or length > max will return error
Parameters:
- min (int): The minimum length that the value must have.
- max (int): The maximum length that the value must have.
- decimal_include (bool): Include decimal or not when calculate length (default: True).
- dot_include (bool): Include dot or not when calculate length (default: False).
- message (str): The error message to be used if the validation fails.