Created
May 24, 2016 19:19
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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