no 100% with 0/0 workers
This commit is contained in:
@@ -39,7 +39,7 @@ class CoverageShift extends Equatable {
|
|||||||
|
|
||||||
/// Calculates the coverage percentage for this shift.
|
/// Calculates the coverage percentage for this shift.
|
||||||
int get coveragePercent {
|
int get coveragePercent {
|
||||||
if (workersNeeded == 0) return 100;
|
if (workersNeeded == 0) return 0;
|
||||||
return ((workers.length / workersNeeded) * 100).round();
|
return ((workers.length / workersNeeded) * 100).round();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ class CoverageStats extends Equatable {
|
|||||||
|
|
||||||
/// Calculates the overall coverage percentage.
|
/// Calculates the overall coverage percentage.
|
||||||
int get coveragePercent {
|
int get coveragePercent {
|
||||||
if (totalNeeded == 0) return 100;
|
if (totalNeeded == 0) return 0;
|
||||||
return ((totalConfirmed / totalNeeded) * 100).round();
|
return ((totalConfirmed / totalNeeded) * 100).round();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user