From b0568ab0cea2ed0a5e85e087637b1358d2b309b2 Mon Sep 17 00:00:00 2001 From: Ahmed Bahajjaj <42177597+madanalogy@users.noreply.github.com> Date: Mon, 13 Nov 2023 18:29:59 +0800 Subject: [PATCH] fix types --- actions.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/actions.py b/actions.py index 4fa4b33..0d98191 100644 --- a/actions.py +++ b/actions.py @@ -19,9 +19,10 @@ async def run_add(chat_id, text): amount = core[1].strip() if not is_valid_amount(amount): return constants.ERROR_PRECONDITION + amount = float(amount) details = { "name": core[0].strip().lower(), - "amount": float(amount), + "amount": amount, "payer": core[2].strip().lower(), } @@ -36,8 +37,9 @@ async def run_add(chat_id, text): owed = parsed[1].strip() if not is_valid_amount(owed): return constants.ERROR_PRECONDITION - owed_amounts[parsed[0].strip()] = float(owed) - running_sum += float(owed) + owed = float(owed) + owed_amounts[parsed[0].strip()] = owed + running_sum += owed else: owed_amounts[parsed[0].strip()] = 0 split_count += 1