Commit 60d52213 authored by jvfpw18's avatar jvfpw18

Round teacherByFormation values in classroomCount

parent a0793fbd
Pipeline #22295 failed with stage
in 60 minutes
......@@ -933,7 +933,7 @@ classroomCountApp.post('/', rqf.parse(), (req, res, next) => {
teacherByFormation.push(0);
}
else {
teacherByFormation.push(req.teacher[i].total / teacherTotal);
teacherByFormation.push(parseFloat((req.teacher[i].total / teacherTotal).toFixed(3)));
i++;
}
}
......@@ -947,7 +947,7 @@ classroomCountApp.post('/', rqf.parse(), (req, res, next) => {
}
let diff = 1 - sum;
// Se for menor que 100 soma na P2 caso exista, se não na P1
if (diff > 0.0000000001) {
if (diff > 0.0001) {
if (teacherByFormation[1] > 0) {
teacherByFormation[1] += diff;
}
......@@ -956,6 +956,8 @@ classroomCountApp.post('/', rqf.parse(), (req, res, next) => {
}
}
// console.log(teacherByFormation)
lastLocations.forEach((location) => {
location.education_level.forEach((educationLevel) => {
let educationLevelId = educationLevel.education_level_short_id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment