From 2a195340a499a3e97d578d94c3b296658e7e2fab Mon Sep 17 00:00:00 2001 From: Jan Date: Wed, 2 Oct 2024 10:10:24 +0200 Subject: [PATCH] Fixes bug in human_readable_stat when input is a string containing a number smaller than 0 --- pm4py/util/vis_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pm4py/util/vis_utils.py b/pm4py/util/vis_utils.py index 8eab41abd..369d8287e 100644 --- a/pm4py/util/vis_utils.py +++ b/pm4py/util/vis_utils.py @@ -62,11 +62,11 @@ def human_readable_stat(timedelta, stat_locale: Optional[Dict[str, str]] = None) elif seconds > 0: return str(seconds) + stat_locale.get("second", "s") else: - c = int(float(timedelta*1000)) + c = int(float(timedelta) * 1000) if c > 0: return str(c) + stat_locale.get("millisecond", "ms") else: - return str(int(float(timedelta * 10**9))) + stat_locale.get("nanosecond", "ns") + return str(int(float(timedelta) * 10**9)) + stat_locale.get("nanosecond", "ns") def get_arc_penwidth(arc_measure, min_arc_measure, max_arc_measure):