diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index c463808e91c..8527eed722f 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -5241,7 +5241,7 @@ class progress_bar implements renderable, templatable { $this->percent = $percent; $this->lastupdate = microtime(true); - echo $OUTPUT->render_progress_bar_update($this->html_id, sprintf("%.1f", $this->percent), $msg, $estimatemsg); + echo $OUTPUT->render_progress_bar_update($this->html_id, $this->percent, $msg, $estimatemsg); flush(); } diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 82ee6ab0062..d5312b07849 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -5140,7 +5140,12 @@ EOD; * @return string ascii fragment */ public function render_progress_bar_update(string $id, float $percent, string $msg, string $estimate) : string { - return html_writer::script(js_writer::function_call('updateProgressBar', [$id, $percent, $msg, $estimate])); + return html_writer::script(js_writer::function_call('updateProgressBar', [ + $id, + round($percent, 1), + $msg, + $estimate, + ])); } /**