Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Commit d2f4bfc

Browse files
committed
Replaced round to floor when showing percent in progress bar
1 parent 233fc40 commit d2f4bfc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Output.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,10 @@ public function setTotalFileCount($count)
118118

119119
protected function progress()
120120
{
121-
if (++$this->checkedFiles % $this->filesPerLine === 0) {
122-
$percent = round($this->checkedFiles/$this->totalFileCount * 100);
121+
++$this->checkedFiles;
122+
123+
if ($this->checkedFiles % $this->filesPerLine === 0) {
124+
$percent = floor($this->checkedFiles/$this->totalFileCount * 100);
123125
$current = $this->stringWidth($this->checkedFiles, strlen($this->totalFileCount));
124126
$this->writeLine(" $current/$this->totalFileCount ($percent %)");
125127
}

0 commit comments

Comments
 (0)