Calculate correct number of rounds
This commit is contained in:
@@ -349,7 +349,7 @@ export class TournamentManageComponent implements OnInit {
|
|||||||
let count = 0;
|
let count = 0;
|
||||||
for (let group of event.groups) {
|
for (let group of event.groups) {
|
||||||
let numTeams = group.teams.length;
|
let numTeams = group.teams.length;
|
||||||
let rounds = Math.trunc(Math.log2(numTeams));
|
let rounds = numTeams <= 4 ? 3 : 4;
|
||||||
let matchesPerRound = Math.trunc(numTeams / 2);
|
let matchesPerRound = Math.trunc(numTeams / 2);
|
||||||
count += (rounds * matchesPerRound);
|
count += (rounds * matchesPerRound);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user