Get the translation progress.

@param bool $round

@return int|float
777085
public function getPercentage($round = true)
    {
        if ($this->numApprovedTranslations === 0 || $this->numTranslatable === 0) {
            $result = $round ? 0 : 0.0;
        } elseif ($this->numApprovedTranslations === $this->numTranslatable) {
            $result = $round ? 100 : 100.0;
        } else {
            $result = $this->numApprovedTranslations * 100.0 / $this->numTranslatable;
            if ($round) {
                $result = max(1, min(99, (int) round($result)));
            }
        }

        return $result;
    }
1198563
public function getProgress()
    {
        $progress = new Progress();
        $progress->percent = $this->__get('progress_percent');
        $progress->step = $this->__get('progress_step');
        $progress->stepName = $this->__get('progress_name');
        $progress->totalSteps = $this->__get('progress_steps');
        $progress->leftOverSeconds = $this->__get('progress_remaining');
        return $progress;
    }
803236
public function progress($bool)
    {
        if (is_bool($bool)) {
            $this->progress = json_encode($bool);
        }

        return $this->setNotifier();
    }
733884
protected function getProgress(): string
    {
        return sprintf(
            ' %' . $this->numTestsWidth . 'd / %' . $this->numTestsWidth . 'd (%3s%%)',
            $this->casesProcessed,
            $this->totalCases,
            floor(($this->totalCases ? $this->casesProcessed / $this->totalCases : 0) * 100)
        );
    }
862430
public function getDecimalIsHalf( $scale = false )
	{
		if ( ! $this->getIsDecimal() ) {
			return false;
		}

		if ( $scale === false ) $scale = $this->scale( $this->_value );
		if ( $scale < 0 ) $scale = $scale = 0;

		$decimalPart = $this->getDecimalPart();
		if ( $scale >= strlen( $decimalPart ) ) return false;

		// Get the portion of the decimal part affected by the scale value
		$decimalPart = substr( $decimalPart, $scale );
		return strlen( $decimalPart ) == 1 && $decimalPart == "5";
	}
227703
protected function get_progress() : \progress_trace {
        if (null === $this->progresstracer) {
            $this->set_progress(new \text_progress_trace());
        }

        return $this->progresstracer;
    }
810843
public function getValue()
    {
        return round($this->amount / $this->currency->getSubunit(), $this->currency->getPrecision());
    }
1100318
public function progress() : int
    {
        return $this->comparing() ?
        $this->group->comparedUser->progress :
        $this->group->fromUser->progress;
    }
900657
public function getDuration($precision = 0, $floatingPrecision = 3, $showUnit = true)
    {
        if (empty($this->endTime)) {
            $this->stop();
        }

        return $this->getFormattedTime($this->endTime - $this->startTime, $precision, $floatingPrecision, $showUnit);
    }
462524
public function convert($value, $targetCurrency, $round = true, $valueCurrency = null)
    {
        return $this->getConverter()->convert($value, $targetCurrency, $round, $valueCurrency);
    }
412179
private function round_($result, $precision) {
        if (abs($result) === INF) {
            return $result;
        }
        $str = strtolower((string) $result);
        if (strpos($str, 'e') !== false) {
            $r = explode('e', $str);
            $left = round((float) $r[0], (int) $precision);
            $right = $r[1];
            return (float) ($left.'e'.$right);
        }
        return round($result, (int) $precision);
    }
310693
public function getNextRoundId($roundId)
    {
       $this->_ensureRounds();

       if ($this->_rounds && $roundId) {
           $next = false;
           foreach ($this->_rounds as $currentRoundId => $round) {
               if ($next) {
                   return $currentRoundId;
               }
               if ($currentRoundId == $roundId) {
                   $next = true;
               }
           }

           return null;

       } elseif ($this->_rounds) {
           end($this->_rounds);
           return key($this->_rounds);
       }
    }
1066952
public function getRound($roundId)
    {
        $this->_ensureRounds();

        if (! isset($this->_rounds[$roundId])) {
            return null;
        }
        if (! isset($this->_roundObjects[$roundId])) {
            $this->_roundObjects[$roundId] = $this->tracker->createTrackClass('Round', $this->_rounds[$roundId]);
        }
        return $this->_roundObjects[$roundId];
    }
650271
public function round(int $scale = 0): Decimal
    {
        if ($scale >= $this->scale) {
            return $this;
        }

        return self::fromString(self::innerRound($this->value, $scale));
    }
874278
public static function bytesToString(int $bytes, int $round = 0): string
    {
        return self::getMeasure($bytes, 0, $round);
    }
182228
public static function getDuration($start)
    {
        $time = microtime();
        $time = explode(' ', $time);
        $time = $time[1] + $time[0];
        $finish = $time;
        
        return round(($finish - $start), 4);
    }
1339903
public function getAmount($baseAmount = null)
    {
        if (is_numeric($this->getFixedAmount())) {
            return $this->getFixedAmount();
        }

        if (null === $baseAmount) {
            $baseAmount = $this->getBaseAmount();
        }

        return round($baseAmount * $this->getRate() / 100, 2);
    }