MDL-84072 output: correct progress bar component percentage parameter.

Avoid mixing float/string types, where the decimal separator could
vary according to current locale (as per previous fix 5a1aef5a, which
was subsequently re-broken by b92886ad).
This commit is contained in:
Paul Holden
2025-01-07 13:14:26 +00:00
parent ab5692acdf
commit a296bdfc5b
3 changed files with 10 additions and 4 deletions
+2 -2
View File
@@ -181,7 +181,7 @@ class progress_bar implements renderable, templatable {
$this->lastupdate = microtime(true);
if ($this->autoupdate) {
echo $OUTPUT->render_progress_bar_update($this->idnumber, sprintf("%.1f", $this->percent), $msg, $estimatemsg);
echo $OUTPUT->render_progress_bar_update($this->idnumber, $this->percent, $msg, $estimatemsg);
flush();
}
}
@@ -307,7 +307,7 @@ class progress_bar implements renderable, templatable {
$this->message = $errormsg;
if ($this->autoupdate) {
echo $OUTPUT->render_progress_bar_update($this->idnumber, sprintf("%.1f", $this->percent), $errormsg, '', true);
echo $OUTPUT->render_progress_bar_update($this->idnumber, $this->percent, $errormsg, '', true);
flush();
}
}