correctly calculate goalie average
This commit is contained in:
1 parent
d5ac42268f
commit
86c4fe316e
3 files changed
+20
-8
No files matched your search
@@ -1010,4 +1010,10 @@ addGoalieStats g1 g2 = GoalieStats
|
||||
|
||||
-- | Determines a goalie's average goals allowed per game.
|
||||
gsAverage :: GoalieStats -> Rational
|
||||
gsAverage gs = fromIntegral (gs^.gsGoalsAllowed) / fromIntegral (gs^.gsGames)
|
||||
gsAverage gs = let
|
||||
allowed = fromIntegral $ gs^.gsGoalsAllowed
|
||||
mins = fromIntegral $ gs^.gsMinsPlayed
|
||||
gLen = fromIntegral gameLength
|
||||
in if mins == 0
|
||||
then 0
|
||||
else allowed / mins * gLen
|
||||
Reference in new issue
Block a user