Skip to content

Commit

Permalink
Properly display message rates when value is < 1 (#1301)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshak2 authored and petersilva committed Nov 29, 2024
1 parent 86fe501 commit 2b9ff66
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sarracenia/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ def baseUrlParse( url ):
import humanize

def naturalSize( num ):
# checking for > 0 allows message rate to print just 0m/s when num is 0 instead of 0.00m/s in sr3 status
# also ensures that data rate displays properly
if num > 0 and num < 1:
return f"{num:.2f}m"
return humanize.naturalsize(num,binary=True).replace(" ","")

def naturalTime( dur ):
Expand Down

0 comments on commit 2b9ff66

Please sign in to comment.