Skip to content

Commit

Permalink
[CORE] initialize weekly total and weekly maximum with zero
Browse files Browse the repository at this point in the history
  • Loading branch information
monolidth committed Feb 19, 2021
1 parent 02817fa commit 390ef06
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/api/weekly_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ class WeeklyApi extends AbstractApi {
final _date = DateTime.now();
List<double> expenses = [0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00];

weeklyTotal = 0.00;
weeklyMaximum = 0.00;
final firstWeekDate =
getDate(_date.subtract(Duration(days: _date.weekday - 1)));

Expand All @@ -63,11 +61,12 @@ class WeeklyApi extends AbstractApi {
}
}
}

for (int i = 0; i < 7; i++) {
expenses[i] = MathUtil.roundDouble(expenses[i], 2);
weeklyTotal += expenses[i];
}
}
weeklyTotal = 0.00;
weeklyMaximum = 0.00;
for (int i = 0; i < 7; ++i) {
expenses[i] = MathUtil.roundDouble(expenses[i], 2);
weeklyTotal += expenses[i];
}

weeklyMaximum =
Expand Down

0 comments on commit 390ef06

Please sign in to comment.