Caplin Trader 4.5.1

Class: module:caplin/core/validator/NumericRangeValidator

module:caplin/core/validator/NumericRangeValidator

Constructor

new module:caplin/core/validator/NumericRangeValidator(errorMessageopt)

The NumericRangeValidator is a module:caplin/trading/validation/Validator that ensures the string being validated is an expression of a decimal number. Empty string is allowed: if you don't want to allow empty string, use the module:br/validation/NotEmptyValidator.
Parameters:
Name Type Attributes Description
errorMessage string <optional>
i18n key for error message to be passed to the ValidationResult.
Implements:

Methods

validate(properties, oValidationResult)

Determine whether parsing the given string results in a decimal number and set result on the provided module:br/validation/ValidationResult.
Parameters:
Name Type Description
properties object A named set of properties to validate.
Properties
Name Type Description
from object An object with a getValue() method that returns the from string to be validated.
to object An object with a getValue() method that returns the to string to be validated.
oValidationResult module:br/validation/ValidationResult The result object that the outcome of the validation will be set on.
Implements: