original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Validates currency conversion rate
  @return boolean|null
docstring_tokens: Validates currency conversion rate