Skip to content

Commit

Permalink
Merge pull request #502 from jlucas95/bugfix/human_readable_stat
Browse files Browse the repository at this point in the history
bugfix in human_readable_stat when timedelta is a string with a number smaller than 1
  • Loading branch information
fit-alessandro-berti authored Nov 6, 2024
2 parents 80f7cee + 2a19534 commit a6d6ffa
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit a6d6ffa

Please sign in to comment.