Commit 1d3301fb authored by Michał Woźniak's avatar Michał Woźniak
Browse files

fix for average-over for new_cfr

parent cf4db9a6
Pipeline #207 passed with stage
in 1 second
...@@ -1406,7 +1406,13 @@ let updateChartData = (siteSelect) => { ...@@ -1406,7 +1406,13 @@ let updateChartData = (siteSelect) => {
for (var j=avg_start; j<=avg_end; j++) { for (var j=avg_start; j<=avg_end; j++) {
mean += arr[j]; mean += arr[j];
} }
acc.push(Math.round(mean / (avg_end - avg_start + 1))) // if we're talking case fatality rate, we should not round
if (dataset === 'cfr') {
acc.push(mean / (avg_end - avg_start + 1))
// everything else nicely rounded
} else {
acc.push(Math.round(mean / (avg_end - avg_start + 1)))
}
return acc return acc
}, []) }, [])
} }
......
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