Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix in human_readable_stat when timedelta is a string with a number smaller than 1 #502

Open
wants to merge 1 commit into
base: release
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pm4py/util/vis_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down