We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf9e3ec commit 83450a9Copy full SHA for 83450a9
SportsAnalyzer/Models/Statistics.cs
@@ -192,12 +192,13 @@ public void CalculateAll()
192
GoalsInIntervalsPercent[i] = Round((GoalsInIntervals[i] / scoredGoalsSum) * 100, 2);
193
}
194
195
- int index = 0;
196
-
197
- for (var i = 0; i < MatchGoals.Count; i++)
+ int numberOfGoals = 0;
+ double numberOfMatches = 0;
+ foreach (var item in MatchGoals)
198
{
199
- index = MatchGoals.Keys.ElementAt(i);
200
- MatchGoalsPct[index] = Round((MatchGoals[index] / MatchesNumber) * 100, 2);
+ numberOfGoals = item.Key;
+ numberOfMatches = item.Value;
201
+ MatchGoalsPct[numberOfGoals] = Round((numberOfMatches / MatchesNumber) * 100, 2);
202
203
204
0 commit comments