Capped Percent Done Value between 0 and 1.

Signed-off-by: Andreas Fahrecker <AndreasFahrecker@gmail.com>
This commit is contained in:
Andreas Fahrecker 2021-02-11 20:28:40 +01:00
parent 1826bbe421
commit c09b164a61

View File

@ -42,7 +42,10 @@ class TimeProgress {
}
double percentDone() {
return this.daysBehind() / (this.allDays() / 100) / 100;
double percent = this.daysBehind() / (this.allDays() / 100) / 100;
if (percent < 0) percent = 0;
if (percent > 1) percent = 1;
return percent;
}
bool hasStarted() {