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. If false, 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
name string
Inherited From:

equals(anObject) → {boolean} source

Returns true if two objects are equal, otherwise returns false.

Parameters:
Name Type Description
anObject Object

The object to compare for equality.

Inherited From:
Returns: boolean

Returns true if the calling object and anObject are identical and their uuid properties are also equal. Otherwise, returns false.

validate(v) → {number} source

Determines if the parameter v is a number or not.

Parameters:
Name Type Description
v string

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

comments powered by Disqus

More help?

Can't find what you are looking for? Get in touch, we're more than happy in helping answer your questions.