Skip to content

Commit

Permalink
🐛 Fix calculating average
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Dec 2, 2020
1 parent 1f13f01 commit 5f37b52
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/helpers/calculate-response-time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ export const getResponseTimeForSite = async (

return {
day: parseInt(Number(daySum.reduce((p, c) => p + c, 0) / daySum.length).toFixed(0)),
week: parseInt(Number(weekSum.reduce((p, c) => p + c, 0) / daySum.length).toFixed(0)),
month: parseInt(Number(monthSum.reduce((p, c) => p + c, 0) / daySum.length).toFixed(0)),
year: parseInt(Number(yearSum.reduce((p, c) => p + c, 0) / daySum.length).toFixed(0)),
all: parseInt(Number(allSum.reduce((p, c) => p + c, 0) / daySum.length).toFixed(0)),
week: parseInt(Number(weekSum.reduce((p, c) => p + c, 0) / weekSum.length).toFixed(0)),
month: parseInt(Number(monthSum.reduce((p, c) => p + c, 0) / monthSum.length).toFixed(0)),
year: parseInt(Number(yearSum.reduce((p, c) => p + c, 0) / yearSum.length).toFixed(0)),
all: parseInt(Number(allSum.reduce((p, c) => p + c, 0) / allSum.length).toFixed(0)),
currentStatus,
};
};

0 comments on commit 5f37b52

Please sign in to comment.