original_string: public function getPercentage($round = true)
      {
          if ($this->translated === 0 || $this->total === 0) {
              $result = $round ? 0 : 0.0;
          } elseif ($this->translated === $this->total) {
              $result = $round ? 100 : 100.0;
          } else {
              $result = $this->translated * 100.0 / $this->total;
              if ($round) {
                  $result = max(1, min(99, (int) round($result)));
              }
          }
  
          return $result;
      }
code: public function getPercentage($round = true)
      {
          if ($this->translated === 0 || $this->total === 0) {
              $result = $round ? 0 : 0.0;
          } elseif ($this->translated === $this->total) {
              $result = $round ? 100 : 100.0;
          } else {
              $result = $this->translated * 100.0 / $this->total;
              if ($round) {
                  $result = max(1, min(99, (int) round($result)));
              }
          }
  
          return $result;
      }
code_tokens: public function getPercentage ( $ round = true ) { if ( $ this -> translated === 0 || $ this -> total === 0 ) { $ result = $ round ? 0 : 0.0 ; } elseif ( $ this -> translated === $ this -> total ) { $ result = $ round ? 100 : 100.0 ; } else { $ result = $ this -> translated * 100.0 / $ this -> total ; if ( $ round ) { $ result = max ( 1 , min ( 99 , ( int ) round ( $ result ) ) ) ; } } return $ result ; }
docstring: Get the translation percentage.
  
  @param bool $round Set to true to get a rounded value (0 if no translations at all, 100 if all strings are translated, 1...99 otherwise),
  
  @return int|float
docstring_tokens: Get the translation percentage .