Return percent completed.

0 is not started or not known
1 is finished
Between 0 and 1 is in process. Value is a float

@return float Percent completed
540258
public function getCompletionPercent()
    {
        $percent = 0;

        if (($this->completed > 0) && ($this->completionTotal > 0)) {

            $percent = $this->completed / $this->completionTotal;
        }

        return $percent;
    }
450775
public function render()
    {
        $percentage = (double) ($this->value / $this->total);

        $progress = floor($percentage * $this->size);
        $output = "\r[" . str_repeat('=', $progress);
        if ($progress < $this->size) {
            $output .= ">" . str_repeat(' ', $this->size - $progress);
        } else {
            $output .= '=';
        }
        $output .= sprintf('] %s%% %s/%s', round($percentage * 100, 0), $this->value, $this->total);

        if ($this->showRemainingTime) {
            $speed = (time() - $this->startTime) / $this->value;
            $remaining = number_format(round($speed * ($this->total - $this->value), 2), 2);
            $output .= " - $remaining sec remaining";
        }

        return $output;
    }
900403
public function getRatio()
    {
        $total = $this->score->getValid() +
            $this->score->getPartial() +
            $this->score->getNotValid();

        return $this->score->getValid() == 0 ? 0 : (float) number_format($this->score->getValid()/$total, 2);
    }
935416
public function getWalletPartialPercent()
    {
        $result = $this->scopeConfig->getValue('payment/prxgt_wallet_pay/partial_percent');
        $result *= 1;
        $result = ($result < 0) || ($result > 1) ? 0 : $result;
        return $result;
    }
627769
private function getPercentage($value)
    {
        $percentage = ($value - $this->min) / ($this->max - $this->min) * 100;

        return $percentage;
    }
475702
def progress(self, value, new_status=None):
    
    space_fillers = 0

    if new_status is not None:
      # if new text is shorter, then we need fill previously used place
      space_fillers = len(self._status_msg) - len(new_status) if self._status_msg and len(self._status_msg) - len(new_status) > 0 else 0
      self._status_msg = new_status

    if not self._infinite_mode and value > self._max:
      self._infinite_mode = True
      self._fill_empty()

    self._timer.tick(value)

    if not self._infinite_mode:
      percent_done = self._calc_percent_done(value)
      filled = self._options.fill_char * int(self._calc_filled_space(percent_done))
      empty = self._options.blank_char * int(self._calc_empty_space(percent_done))
    else:
      percent_done = 100
      self._infinite_position = 1 if self._infinite_position + self._infinite_width >= self._width else self._infinite_position + 1
      filled = "%s%s" % (self._options.blank_char * (self._infinite_position - self._infinite_width), self._options.fill_char * self._infinite_width)
      empty = self._options.blank_char * int(self._width - self._infinite_position)

    kwargs = {
      "begin_line": self._begin_line_character,
      "text": self._text,
      "status": self._status_msg,
      "end_line": " " * space_fillers,
      "filled": filled,
      "reverse_filled": filled[::-1],
      "empty": empty,
      "value": int(value),
      "max": int(self._max),
      "items_per_sec": self._timer.unit_per_sec,
      "percents_done": percent_done
    }

    self.stdout.write(safe_format(self._options.progress_format.value, **kwargs))
    self.stdout.flush()
452168
function(percentage) {
					var min = (this.options.min === 0) ? 0 : Math.log(this.options.min);
					var max = Math.log(this.options.max);
					var value = Math.exp(min + (max - min) * percentage / 100);
					value = this.options.min + Math.round((value - this.options.min) / this.options.step) * this.options.step;
					/* Rounding to the nearest step could exceed the min or
					 * max, so clip to those values. */
					if (value < this.options.min) {
						return this.options.min;
					} else if (value > this.options.max) {
						return this.options.max;
					} else {
						return value;
					}
				}
513356
def percent(self, value: float) -> 'Size':
        """"""
        raise_not_number(value)
        self.maximum = '{}%'.format(value)
        return self
392854
def ratio_and_percentage_with_time_remaining(current, total, time_remaining):
    """"""
    return "{} / {} ({}% completed) (~{} remaining)".format(
      current,
      total,
      int(current / total * 100),
      time_remaining)
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;
    }
214826
private synchronized float getInternal() {
    int phaseCount = phases.size();
    if (phaseCount != 0) {
      float subProgress =
        currentPhase < phaseCount ? phase().getInternal() : 0.0f;
      return progressPerPhase*(currentPhase + subProgress);
    } else {
      return progress;
    }
  }
1089227
public function calculatePercentage($decimal = 1)
    {
        // Profile not loaded yet.
        if (is_null($this->percentile)) {
            return null;
        }

        // Calculate percentage and return value
        return (float) number_format($this->percentile * 100, $decimal, '.', '');
    }
779449
def report

      percent = @current.to_f/ @max.to_f
      percent = 0.001 if percent < 0.001
      if @desc != ""
        indicator = @desc + ": "
      else
        indicator = "Progress "
      end
      indicator += "["
      10.times{|i|
        if i < percent * 10 then
          indicator += "."
        else
          indicator += " "
        end
      }
      indicator += "]   done #{(percent * 100).to_i}% "

      eta =  (Time.now - @time)/percent * (1-percent)
      eta = eta.to_i
      eta = [eta/3600, eta/60 % 60, eta % 60].map{|t| "%02i" % t }.join(':')

      used = (Time.now - @time).to_i
      used = [used/3600, used/60 % 60, used % 60].map{|t|  "%02i" % t }.join(':')

      indicator += " (Time left #{eta} seconds) (Started #{used} seconds ago)"

      STDERR.print("\033[#{@depth + 1}F\033[2K" + indicator + "\n\033[#{@depth + 2}E")
    end
1064347
def get_progress(self):
        

        count_remaining = len(self.items_queued) + len(self.items_in_progress)
        percentage_remaining = 100 / self.count_total * count_remaining

        return 100 - percentage_remaining
1175535
function (percent) {
            var rounded = Math.round(percent / this.coords.p_step) * this.coords.p_step;

            if (rounded > 100) {
                rounded = 100;
            }
            if (percent === 100) {
                rounded = 100;
            }

            return this.toFixed(rounded);
        }
1254679
@SuppressWarnings("MagicNumber")
    @Override
    public void indicateProgressPercentage(long number, long total) {
        verifySystemOut();
        progressIndicatorActive = true;
        String currMsg = lastMessage;
        try {
            int percentage = Math.round(NumberMath.multiply(NumberMath.divide(number, total), 100).floatValue());

            if (!isAnsiEnabled()) {
                out.print("..");
                out.print(percentage + '%');
            } else {
                updateStatus(currMsg + ' ' + percentage + '%');
            }
        } finally {
            lastMessage = currMsg;
        }
    }
315348
def global_unlock_percent(self):
        
        percent = CRef.cfloat()
        result = self._iface.get_ach_progress(self.name, percent)

        if not result:
            return 0.0

        return float(percent)