Skip to content

Instantly share code, notes, and snippets.

@flanger001
Created May 24, 2016 19:19
Show Gist options
  • Save flanger001/1c08b8588220d146494a2cebb026a5a3 to your computer and use it in GitHub Desktop.
Save flanger001/1c08b8588220d146494a2cebb026a5a3 to your computer and use it in GitHub Desktop.
If you need to know what percentage one number is of another number
# Maybe not the worst monkey patch ever, but don't do this
class Numeric
def is_what_percent_of(num)
100 * (self.to_f/num)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment