original_string: protected function validateDecimalsCurrency()
      {
          $field = 'decimals';
          $value = $this->getSubmitted($field);
  
          if (!isset($value)) {
              $this->unsetSubmitted($field);
              return null;
          }
  
          if (preg_match('/^[0-2]+$/', $value) !== 1) {
              $this->setErrorInvalid($field, $this->translation->text('Decimals'));
              return false;
          }
  
          return true;
      }
code: protected function validateDecimalsCurrency()
      {
          $field = 'decimals';
          $value = $this->getSubmitted($field);
  
          if (!isset($value)) {
              $this->unsetSubmitted($field);
              return null;
          }
  
          if (preg_match('/^[0-2]+$/', $value) !== 1) {
              $this->setErrorInvalid($field, $this->translation->text('Decimals'));
              return false;
          }
  
          return true;
      }
code_tokens: protected function validateDecimalsCurrency ( ) { $ field = 'decimals' ; $ value = $ this -> getSubmitted ( $ field ) ; if ( ! isset ( $ value ) ) { $ this -> unsetSubmitted ( $ field ) ; return null ; } if ( preg_match ( '/^[0-2]+$/' , $ value ) !== 1 ) { $ this -> setErrorInvalid ( $ field , $ this -> translation -> text ( 'Decimals' ) ) ; return false ; } return true ; }
docstring: Validates currency decimals
  @return boolean|null
docstring_tokens: Validates currency decimals