Skip to content

Commit

Permalink
fix: busted median value API
Browse files Browse the repository at this point in the history
  • Loading branch information
Newton Koumantzelis committed Mar 25, 2020
1 parent df5e08e commit ef931c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const api = {
const middleIndex = Math.floor(usageStatsAboveZero.length / 2);

if (usageStatsAboveZero.length % 2) {
return data[middleIndex][1];
return usageStatsAboveZero[middleIndex][1];
}

return (usageStatsAboveZero[middleIndex - 1][1] + usageStatsAboveZero[middleIndex + 1][1]) / 2;
Expand Down

0 comments on commit ef931c9

Please sign in to comment.