module Percentify::CoreExtensions::Numeric

Public Instance Methods

as_percentage_of(number) click to toggle source
# File lib/percentify/core_extensions/numeric.rb, line 6
def as_percentage_of(number)
  (to_f / number.to_f) * 100
end
percent_of(number) click to toggle source
# File lib/percentify/core_extensions/numeric.rb, line 10
def percent_of(number)
  (to_f / 100.to_f) * number.to_f
end