Skip to content

Commit

Permalink
Show championship odds instead of world series odds
Browse files Browse the repository at this point in the history
  • Loading branch information
rcy committed Oct 21, 2023
1 parent 538c456 commit d437ed1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions handlers/mlb/mlb.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import (
)

type TeamEndData struct {
//PoffTitle float64
WsWin float64
PoffTitle float64
WsWin float64
CsWin float64
}

type Team struct {
Expand All @@ -28,8 +29,8 @@ type TeamList []Team
func (tl TeamList) String() string {
arr := []string{}
for _, team := range tl {
if team.EndData.WsWin != 0.0 {
arr = append(arr, fmt.Sprintf("%s:%.0f%%", team.AbbName, 100*team.EndData.WsWin))
if team.EndData.CsWin != 0.0 {
arr = append(arr, fmt.Sprintf("%s:%.0f%%", team.AbbName, 100*team.EndData.CsWin))
}
}
return strings.Join(arr, " ")
Expand All @@ -52,7 +53,7 @@ func fetchTeams() (TeamList, error) {
}

sort.Slice(teams, func(i, j int) bool {
return teams[i].EndData.WsWin > teams[j].EndData.WsWin
return teams[i].EndData.CsWin > teams[j].EndData.CsWin
})

return teams, nil
Expand Down

0 comments on commit d437ed1

Please sign in to comment.