From 7216e380607cc3baca1768f90b16e24adf8ce422 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 8 Nov 2016 13:39:45 +0100 Subject: [PATCH] add rounded parameter to wallpaper price calculations --- api/lib/prices.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/api/lib/prices.py b/api/lib/prices.py index be95bc3..a2ae8e1 100644 --- a/api/lib/prices.py +++ b/api/lib/prices.py @@ -32,9 +32,9 @@ def material_price(material, market, designer=None, reseller=None, rounded=True, return price -def wallpaper_price(width, height, material, market, designer=None, reseller=None, inc_vat=True): +def wallpaper_price(width, height, material, market, designer=None, reseller=None, rounded=True, inc_vat=True): m2_price = material_price( - material, market, designer, reseller, inc_vat=False) + material, market, designer, reseller, rounded=rounded, inc_vat=False) # calculate price per square meter sqm = (width / 100) * (height / 100) @@ -52,7 +52,9 @@ def wallpaper_price(width, height, material, market, designer=None, reseller=Non if inc_vat: price *= market.vat - return round(price) + if rounded: + price = round(price) + return price def canvas_cm2_price(cm2):