lib/baseball/fielding.rb in baseball-1.0.0 vs lib/baseball/fielding.rb in baseball-1.1.0
- old
+ new
@@ -7,11 +7,10 @@
def fielding_percentage
plays = @player[:put_outs] + @player[:assists]
plays_plus_errors = plays + @player[:errors]
player_avg = plays.to_f / plays_plus_errors.to_f
avg = player_avg.round(3)
- fielding_percentage = avg.to_s.sub!("0", "")
- figure_trailing_zeroes(fielding_percentage)
+ figure_lead_and_trailing_zeroes(avg)
end
end
end