From bca2aec7742199f5cc06958ac77fdd8f8165a2a3 Mon Sep 17 00:00:00 2001
From: Gjorgji <g.noveski@yahoo.com>
Date: Tue, 13 Jun 2023 14:19:06 +0200
Subject: [PATCH] Removes 1 in RE text

---
 app/api/dexi.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/api/dexi.py b/app/api/dexi.py
index 892f201..8402298 100644
--- a/app/api/dexi.py
+++ b/app/api/dexi.py
@@ -184,6 +184,8 @@ def create_recommendation_text(kpi, amount_changed, caused_by, step_size):
         return ""
     if 'co2' in caused_by.replace(' ', '').lower() and 'co2' in kpi.replace(' ', '').lower():
         return ""
+    if amount_changed < 0:
+        amount_changed *= -1
     return f'In order to change the KPI of {kpi} by {int(amount_changed)*10}%, {caused_by} should be improved by {step_size*10}%.\n'
 
 
-- 
GitLab