From bc14205d29bb5ed8c80ff285589eba4ea8304dd4 Mon Sep 17 00:00:00 2001 From: Qwann Date: Wed, 1 Feb 2017 19:32:18 +0100 Subject: [PATCH 1/2] fixing decimal issue2 --- kfet/templatetags/kfet_tags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kfet/templatetags/kfet_tags.py b/kfet/templatetags/kfet_tags.py index 59840b27..2dd704b6 100644 --- a/kfet/templatetags/kfet_tags.py +++ b/kfet/templatetags/kfet_tags.py @@ -40,6 +40,6 @@ def highlight_clipper(clipper, q): @register.filter() def ukf(balance, is_cof): - grant = is_cof and (1 + Settings.SUBVENTION_COF() / 100) or 1 + grant = 1 + float(Settings.SUBVENTION_COF()) / 100 if is_cof else 1. # float nécessaire car sinon problème avec le round de future.builtins return floor(float(balance) * 10 * grant) From 44202811ae09e118482db18092b435504ef8dac4 Mon Sep 17 00:00:00 2001 From: Qwann Date: Sun, 5 Feb 2017 22:39:20 +0100 Subject: [PATCH 2/2] not supporting future.builtins anymore in templatetags --- kfet/templatetags/kfet_tags.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kfet/templatetags/kfet_tags.py b/kfet/templatetags/kfet_tags.py index 2dd704b6..3b1bb639 100644 --- a/kfet/templatetags/kfet_tags.py +++ b/kfet/templatetags/kfet_tags.py @@ -40,6 +40,5 @@ def highlight_clipper(clipper, q): @register.filter() def ukf(balance, is_cof): - grant = 1 + float(Settings.SUBVENTION_COF()) / 100 if is_cof else 1. - # float nécessaire car sinon problème avec le round de future.builtins - return floor(float(balance) * 10 * grant) + grant = is_cof and (1 + Settings.SUBVENTION_COF() / 100) or 1 + return floor(balance * 10 * grant)