From b33271ce7d7d19a4eaa5d0489014e55e6f6b54b5 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 7 Dec 2019 19:38:33 +0530 Subject: [PATCH] Make vat_rate Decimal before Decimal operations --- utils/hosting_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/hosting_utils.py b/utils/hosting_utils.py index d4d27405..73e2c035 100644 --- a/utils/hosting_utils.py +++ b/utils/hosting_utils.py @@ -104,8 +104,8 @@ def get_vm_price_for_given_vat(cpu, memory, ssd_size, hdd_size=0, (decimal.Decimal(hdd_size) * pricing.hdd_unit_price) ) - vat = price * vat_rate * decimal.Decimal(0.01) - vat_percent = pricing.vat_percentage + vat = price * decimal.Decimal(vat_rate) * decimal.Decimal(0.01) + vat_percent = vat_rate cents = decimal.Decimal('.01') price = price.quantize(cents, decimal.ROUND_HALF_UP)