From b7bf4dc28a887e42f01d7d6ece294f6b9acfcb5a Mon Sep 17 00:00:00 2001
From: fgs21 <fgs21@inf.ufpr.br>
Date: Tue, 22 Apr 2025 10:45:44 -0300
Subject: [PATCH] [hotfix] Rounding with 2 decimal numbers working

---
 src/libs/routes_v1/populationOutOfSchool.js | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/src/libs/routes_v1/populationOutOfSchool.js b/src/libs/routes_v1/populationOutOfSchool.js
index cac33a68..99d991a5 100644
--- a/src/libs/routes_v1/populationOutOfSchool.js
+++ b/src/libs/routes_v1/populationOutOfSchool.js
@@ -445,29 +445,12 @@ function matchQueries(queryPartial, queryTotal) {
         if(objMatch) {
             newObj.denominator = result.total;
             newObj.pop_total = objMatch.total;
-            newObj.total = Math.round((objMatch.total / result.total) * 100)
+            newObj.total = Math.round((objMatch.total / result.total) * 10000) / 100;
             match.push(newObj);
         }
     }
 )
 
-
-   /*  console.log("tamanho: " + match.length);
-    console.log(match[10])
-    for (let i = 7; i < match.length; i++) {
-        console.log("i: " , i)
-        match[6].denominator += match[i].denominator;
-        match[6].pop_total += match[i].pop_total;
-        }
-
-    
-    console.log("chega aqui")
-    match[6].total = Math.round((match[6].pop_total / match[6].denominator) * 100)
-    console.log("match 6: " , match[6].total)
-
- 
-    match.splice(7, 4) */
-
     console.log(match)
 
     return match;
-- 
GitLab