From c8bea5ebec0b9b2cc34886e66ed887418b5f44ce Mon Sep 17 00:00:00 2001 From: Waldek Date: Mon, 5 Apr 2021 18:42:23 +0200 Subject: [PATCH] TX time round a number upward --- monitor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/monitor.py b/monitor.py index df2fd8e..8fd63b5 100644 --- a/monitor.py +++ b/monitor.py @@ -34,6 +34,7 @@ import datetime import os import csv +import math from itertools import islice from subprocess import check_call, CalledProcessError @@ -777,7 +778,7 @@ def process_message(_bmessage): for row in islice(reversed(list(csv.reader(textfile))),400): duration_in_s = 0 duration=row[1] - dur=str(int(float(duration.strip()))) + dur=str(int(math.ceil(float(duration.strip())))) year=int(float(row[0][:4].strip())) month=int(float(row[0][5:7].strip())) day=int(float(row[0][8:10].strip())) @@ -794,7 +795,7 @@ def process_message(_bmessage): if dur=="0": txdur="∞" else: - txdur=str(int(float(duration.strip()))) + txdur=str(int(math.ceil(float(duration.strip())))) durtx=""+txdur+"" if row[10] not in my_list: if row[11].strip().isdigit() or row[11] == "N0CALL" or row[11] == "NOCALL":