Skip to content
Snippets Groups Projects
Commit 9f5a017a authored by Pedro Pablo Cardona Arroyave's avatar Pedro Pablo Cardona Arroyave
Browse files

The endpoint to get the annuakky CO2 per person was fixed to be more frinedly with the new users

parent 901dffca
No related branches found
No related tags found
No related merge requests found
......@@ -113,7 +113,11 @@ public class StatisticUtil {
long diffInDays = diffInMillis / (24 * 60 * 60 * 1000);
double co2Sum = 0.0;
for (double c02 : co2List) co2Sum += c02;
return co2Sum / (((double) (diffInDays +1) / 365.0) * (double) numberOfPerson);
if(diffInDays >= 365){
return co2Sum / (((double) (diffInDays +1) / 365.0) * (double) numberOfPerson);
}else {
return (((co2Sum)/((double) numberOfPerson) + 118.0) /2.0);
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment