class Numeric

Public Instance Methods

number_of(n) click to toggle source
# File lib/montecasting/numeric.rb, line 8
def number_of(n)
  nmbof = (self.to_f * n.to_f) / 100.0
  nmbof.nan? ? 0 : nmbof
end
percent_of(n) click to toggle source
# File lib/montecasting/numeric.rb, line 3
def percent_of(n)
  percnt = self.to_f / n.to_f * 100.0
  percnt.nan? ? 0 : percnt
end