From d9b9bc17a5daae5568068cd9a101495a5c10432a Mon Sep 17 00:00:00 2001 From: www-data Date: Wed, 18 Nov 2020 22:58:17 +0300 Subject: [PATCH] round floats --- finapp/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/finapp/views.py b/finapp/views.py index be7c6a9..9a7edde 100644 --- a/finapp/views.py +++ b/finapp/views.py @@ -90,7 +90,7 @@ class AllTimePay(DetailView): fio = abon.fio ballance = float(abon.ballance) return { - 'balance': ballance, + 'balance': round(ballance, 2), 'name': fio, 'account': pay_account, 'service_id': self.object.service_id, @@ -129,7 +129,7 @@ class AllTimePay(DetailView): return { 'pay_id': pay_id, 'service_id': data.get('SERVICE_ID'), - 'amount': pay_amount, + 'amount': round(pay_amount, 2), 'status_code': 22, 'time_stamp': self.current_date } @@ -143,7 +143,7 @@ class AllTimePay(DetailView): 'transaction': { 'pay_id': pay_id, 'service_id': data.get('SERVICE_ID'), - 'amount': pay.summ, + 'amount': round(pay.summ, 2), 'status': 111, 'time_stamp': pay.date_add.strftime("%d.%m.%Y %H:%M") }