Convert price parameters to float

This commit is contained in:
PCoder 2019-01-12 11:40:00 +01:00
parent 484bd53bd2
commit 2186ff1250

View file

@ -123,7 +123,7 @@ def get_vm_price_with_vat(cpu, memory, ssd_size, hdd_size=0,
)
discount = {
'name': pricing.discount_name,
'amount': round(pricing.discount_amount, 2)
'amount': round(float(pricing.discount_amount), 2)
}
price_after_discount = price - discount['amount']
@ -135,12 +135,12 @@ def get_vm_price_with_vat(cpu, memory, ssd_size, hdd_size=0,
vat_percent = pricing.vat_percentage
return {
'price': round(price, 2),
'vat': round(vat, 2),
'vat_percent': round(vat_percent, 2),
'price': round(float(price), 2),
'vat': round(float(vat), 2),
'vat_percent': round(float(vat_percent), 2),
'discount': discount,
'price_after_discount': round(price_after_discount, 2),
'total_price': round(price_after_discount + vat, 2)
'price_after_discount': round(float(price_after_discount), 2),
'total_price': round(float(price_after_discount + vat), 2)
}