From d8a532e7b082b0fec0999fc35f5bd889ebeaa9dc Mon Sep 17 00:00:00 2001 From: PCoder Date: Thu, 6 Sep 2018 00:26:08 +0200 Subject: [PATCH] Round discount to 2 decimal points also --- utils/hosting_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/hosting_utils.py b/utils/hosting_utils.py index ecbeb098..2918deb3 100644 --- a/utils/hosting_utils.py +++ b/utils/hosting_utils.py @@ -127,7 +127,7 @@ def get_vm_price_with_vat(cpu, memory, ssd_size, hdd_size=0, vat = vat.quantize(cents, decimal.ROUND_HALF_UP) discount = { 'name': pricing.discount_name, - 'amount': float(pricing.discount_amount), + 'amount': round(float(pricing.discount_amount),2) } return (round(float(price), 2), round(float(vat), 2), round(float(vat_percent)), discount)