new module:ct-core /validator /Decimal Validator(error Messageopt)
The DecimalValidator
is a module:ct-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(value, attributesopt, validation Result)
Determine whether parsing the given string results in a decimal number and set result on the provided
module:br-validation/ValidationResult
.
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
value |
string | number | The value to validate (must be a string, number or undefined). |
|||||||||
attributes |
object |
<optional> |
attributes to control the validation process. Properties
|
||||||||
validationResult |
module:br-validation |
the ValidationResult in which to store the result of this validation. |
- Implements: