Skip to content

Commit

Permalink
fix rounding of integer -> fix wrong rating
Browse files Browse the repository at this point in the history
crystal 1.0.0 introduced a breaking change with rounding
crystal-lang/crystal#10508.
  • Loading branch information
koffeinfrei committed Jul 8, 2021
1 parent 7902192 commit 4786ce0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/recommender.cr
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class Recommender
def initialize(scores)
@scores = scores.values.reject(MissingScore)
@mostly_count = (@scores.size * 0.75).round.to_i
@half_count = (@scores.size * 0.5).round.to_i
@minor_count = (@scores.size * 0.25).round.to_i
@half_count = (@scores.size * 0.5).round(mode: :ties_away).to_i
@minor_count = (@scores.size * 0.25).round(mode: :ties_away).to_i
end

def single_score?
Expand Down

0 comments on commit 4786ce0

Please sign in to comment.