Skip to content

Instantly share code, notes, and snippets.

@dogweather
Created December 13, 2013 20:33
Show Gist options
  • Save dogweather/7950881 to your computer and use it in GitHub Desktop.
Save dogweather/7950881 to your computer and use it in GitHub Desktop.
Define a function
def percentage_of_whole(part1, part2)
part1.to_f / (part1 + part2) * 100
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment