From d6b5e2f0686a791e60b33de95bafe1f66e2002b3 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Wed, 21 Jun 2017 17:31:26 +0200 Subject: [PATCH] [8.0][FIX] rounding error Fix rounding error for compare_method pct. --- mis_builder/models/mis_builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mis_builder/models/mis_builder.py b/mis_builder/models/mis_builder.py index c4d6eaad..02defbea 100644 --- a/mis_builder/models/mis_builder.py +++ b/mis_builder/models/mis_builder.py @@ -187,7 +187,7 @@ class MisReportKpi(models.Model): elif self.compare_method == 'pct': if base_value and round(base_value, self.dp) != 0: delta = (value - base_value) / abs(base_value) - if delta and round(delta, self.dp) != 0: + if delta and round(delta * 100, self.dp) != 0: return self._render_num( lang_id, delta,