NumberValidator source
Validates that a string can be represented as a numeric value, and returns the numeric value.
Specializes Validator
Properties
-
allowFloat :Property source
-
Indicates whether floating point values are allowed. If
true(the default) then the validator attempts to parse the string as a float value. Iffalse, it attempts to parse the value as an integer.Default Value: - {boolean} true
-
allowNegative :Property source
-
Default Value: - {boolean} true
Methods
-
callDelegateMethod(name) source
-
This method calls the method named with the identifier prefix if it exists. Example: If the name parameter is "shouldDoSomething" and the caller's identifier is "bob", then this method will try and call "bobShouldDoSomething"
Parameters:
Name Type Description namestring Inherited From: -
equals(anObject) → {boolean} source
-
Returns true if two objects are equal, otherwise returns false.
Parameters:
Name Type Description anObjectObject The object to compare for equality.
Inherited From: Returns: boolean
Returns
trueif the calling object andanObjectare identical and theiruuidproperties are also equal. Otherwise, returnsfalse. -
validate(v) → {number} source
-
Determines if the parameter
vis a number or not.Parameters:
Name Type Description vstring The value to validate as a number.
Returns: number
num An integer or float, if the value provided to the function can parsed as a number; otherwise returns an error.
Generated from a4679af