Skip to content

Commit

Permalink
stats: Fix some arithmetic errors for empty stats tables
Browse files Browse the repository at this point in the history
  • Loading branch information
bpfoley authored and cpeel committed Mar 27, 2024
1 parent 8f39513 commit 61c6b14
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stats/pages_in_states.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// ---------------

$stage_labels[] = 'New';
$unavail_n_pages[] = $n_pages_[PROJ_NEW];
$unavail_n_pages[] = $n_pages_[PROJ_NEW] ?? 0;
$waiting_n_pages[] = 0;
$available_n_pages[] = 0;
$progordone_n_pages[] = 0;
Expand Down
2 changes: 1 addition & 1 deletion stats/round_backlog.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function _get_round_backlog_data()
$stats_total = array_sum($stats);

// calculate the goal percent as 100 / number_of_phases
$goal_percent = ceil(100 / count($stats));
$goal_percent = ceil(100 / min(1, count($stats)));

// colors
$barColors = [];
Expand Down
2 changes: 1 addition & 1 deletion stats/round_backlog_days.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function _get_round_backlog_days_data()
$stats_total = array_sum($stats);

// calculate the goal percent as 100 / number_of_phases
$goal_percent = ceil(100 / count($stats));
$goal_percent = ceil(100 / min(1, count($stats)));

// colors
$barColors = [];
Expand Down

0 comments on commit 61c6b14

Please sign in to comment.