Skip to content

Commit

Permalink
fixes over percent
Browse files Browse the repository at this point in the history
  • Loading branch information
Ermodo committed Apr 17, 2021
1 parent 725730b commit 09e8b7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/src/agent/brains/szenario.brain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ export class SzenarioBrain extends Brain {

const totalDuration = differenceInSeconds(this.startDate, this.endDate);
const progressDuration = differenceInSeconds(this.startDate, time);
this.finishedPercent = (progressDuration / totalDuration) * 100;
this.finishedPercent =
100 * Math.min(1, progressDuration / totalDuration);

if (!datapoint) return;

Expand Down

0 comments on commit 09e8b7c

Please sign in to comment.