From 2b9ff66885b63f188dd6bae1f506ba4f5ba6e00d Mon Sep 17 00:00:00 2001 From: Mathew Shaker Date: Thu, 28 Nov 2024 23:25:04 +0000 Subject: [PATCH] Properly display message rates when value is < 1 (#1301) --- sarracenia/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sarracenia/__init__.py b/sarracenia/__init__.py index f0c8b64da..8a6da043d 100755 --- a/sarracenia/__init__.py +++ b/sarracenia/__init__.py @@ -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 ):