From 4ef0291dbdb74314362af1feb5f02f19eba72c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=BD=C3=A1=C4=8Dek?= Date: Thu, 21 Apr 2022 08:11:25 +0200 Subject: [PATCH] dataamount math fixed on req. by Manik --- ucetnictvi_vfcz.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ucetnictvi_vfcz.py b/ucetnictvi_vfcz.py index 7ae2d43..72dc665 100644 --- a/ucetnictvi_vfcz.py +++ b/ucetnictvi_vfcz.py @@ -44,7 +44,7 @@ def add_dictsms(id, pricesms): def add_dictdataamount(id, dataamount): dict = dictionary.get(id) - dataamount = round(float(dataamount)/1024, 2) + dataamount = round(float(dataamount)/1024/1024, 2) print("increasing dataamount dict key for dict: ",dict," for :",dataamount) dict["dataamount"] += dataamount @@ -167,8 +167,7 @@ with open('output_VFCZ_'+ext_date_from_filaname, 'w') as f: - - writer.writerow([key, "N/A", "N/A", data, dataamount, sms, smscount, other, "N/A"]) + writer.writerow([key, "N/A", "N/A", round(float(data)), round(float(dataamount), 2), sms, smscount, other, "N/A"]) with open('output_VFCZ_'+ext_date_from_filaname, "rb") as f: