protected function validateConvertionRateCurrency()
    {
        $field = 'conversion_rate';
        $value = $this->getSubmitted($field);

        if (!isset($value)) {
            return null;
        }

        $label = $this->translation->text('Conversion rate');

        if (empty($value) || strlen($value) > 10) {
            $this->setErrorLengthRange($field, $label, 1, 10);
            return false;
        }

        if (preg_match('/^[0-9]\d*(\.\d+)?$/', $value) !== 1) {
            $this->setErrorInvalid($field, $label);
            return false;
        }

        return true;
    }
protected function validateConvertionRateCurrency()
    {
        $field = 'conversion_rate';
        $value = $this->getSubmitted($field);

        if (!isset($value)) {
            return null;
        }

        $label = $this->translation->text('Conversion rate');

        if (empty($value) || strlen($value) > 10) {
            $this->setErrorLengthRange($field, $label, 1, 10);
            return false;
        }

        if (preg_match('/^[0-9]\d*(\.\d+)?$/', $value) !== 1) {
            $this->setErrorInvalid($field, $label);
            return false;
        }

        return true;
    }
protected function validateConvertionRateCurrency ( ) { $ field = 'conversion_rate' ; $ value = $ this -> getSubmitted ( $ field ) ; if ( ! isset ( $ value ) ) { return null ; } $ label = $ this -> translation -> text ( 'Conversion rate' ) ; if ( empty ( $ value ) || strlen ( $ value ) > 10 ) { $ this -> setErrorLengthRange ( $ field , $ label , 1 , 10 ) ; return false ; } if ( preg_match ( '/^[0-9]\d*(\.\d+)?$/' , $ value ) !== 1 ) { $ this -> setErrorInvalid ( $ field , $ label ) ; return false ; } return true ; }
Validates currency conversion rate
@return boolean|null
Validates currency conversion rate