Module: Workarea::CalculatePercentChange

Defined in:
app/models/workarea/calculate_percent_change.rb

Instance Method Summary collapse

Instance Method Details

#calculate_percent_change(first, second) ⇒ Object



3
4
5
6
# File 'app/models/workarea/calculate_percent_change.rb', line 3

def calculate_percent_change(first, second)
  return nil if first.blank? || first.zero?
  ((second.to_f - first) / first.to_f) * 100
end