Class: Numeric

Inherits:
Object
  • Object
show all
Defined in:
lib/zbox/ext/numeric.rb

Class Method Summary collapse

Class Method Details

.percentage_of(divnum) ⇒ Object


3
4
5
# File 'lib/zbox/ext/numeric.rb', line 3

def percentage_of(divnum)
  sprintf("%0.0f",self.to_f/divnum.to_f*100)+"%"
end