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

Merge branch '250-finish-the-last-statistic-algorithm-to-get-co2' into 'main'

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

Closes #250

See merge request idatt2106-v23-03/backend!199
parents 665ebd8c 1a71aeac
No related branches found
No related tags found
No related merge requests found
...@@ -116,7 +116,7 @@ public class StatisticUtil { ...@@ -116,7 +116,7 @@ public class StatisticUtil {
if(diffInDays >= 365){ if(diffInDays >= 365){
return co2Sum / (((double) (diffInDays +1) / 365.0) * (double) numberOfPerson); return co2Sum / (((double) (diffInDays +1) / 365.0) * (double) numberOfPerson);
}else { }else {
return (((co2Sum)/((double) numberOfPerson) + 118.0) /2.0); return (118.0/diffInDays) + (( co2Sum / (((double) (diffInDays +1) / 365.0) * (double) numberOfPerson))/(365.0-(double) diffInDays));
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment