From 570986376ef05f6cf81caefabf3e9b12f42366db Mon Sep 17 00:00:00 2001 From: Javierete <72128184+Javierete@users.noreply.github.com> Date: Thu, 7 Mar 2024 13:14:05 +0800 Subject: [PATCH] number format in Update progress.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated line 275 to allow for the number format to be introduced in the "monitor" and "monitor_end" parameters. In the current code, monitor = ("{count:,}/{total:,} [{percent:3.1%}] - processing "), throws an error. By adding these mods, the error is gone and the display show all the python formats available. e.g. below: |████████████████████████████████████████| 1,000/1,000 [100.00%] - ### COMPLETED ### in 15.8s (63.41/s) I hope it doesn't ruins something else in the code. --- alive_progress/core/progress.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alive_progress/core/progress.py b/alive_progress/core/progress.py index 60176b2..8ed4b2e 100644 --- a/alive_progress/core/progress.py +++ b/alive_progress/core/progress.py @@ -272,7 +272,7 @@ def rate_text(precision): def monitor_run(f, precision=config.precision): run.monitor_text = human_count(run.count, precision) - return f.format(count=run.monitor_text, total=total_human, percent=run.percent) + return f.format(count=float(run.monitor_text), total=float(total_human), percent=run.percent) def monitor_end(f): warning = '(!) ' if total is not None and current() != logic_total else ''