Skip to content

Instantly share code, notes, and snippets.

@astanway
Last active December 13, 2015 21:48
Show Gist options
  • Save astanway/4979720 to your computer and use it in GitHub Desktop.
Save astanway/4979720 to your computer and use it in GitHub Desktop.
@participations = 0
@hacks.each do |hack|
@participations += hack.hackers_count
end
unless @participations == 0
@average = sprintf("%.1f", (@hacks.length / @participations))
else
@average = 0
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment