Capped Percent Done Value between 0 and 1.
Signed-off-by: Andreas Fahrecker <AndreasFahrecker@gmail.com>
This commit is contained in:
parent
1826bbe421
commit
c09b164a61
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user