class Rational

Public Class Methods

[](*args) click to toggle source

Alternate initializer (‘Rational`)

# File lib/epitools/core_ext/numbers.rb, line 483
def self.[](*args)
  Rational(*args)
end

Public Instance Methods

percent(decimals=1) click to toggle source

Convert the float to a rounded percentage string (eg: “42.5%”) (see: Float#percent)

# File lib/epitools/core_ext/numbers.rb, line 476
def percent(decimals=1)
  to_f.percent(decimals)
end