Module: Sinatra::AbingoObject::ConversionRate
- Defined in:
- lib/sinmetrics/abingo.rb
Instance Method Summary collapse
Instance Method Details
#conversion_rate ⇒ Object
212 213 214 215 |
# File 'lib/sinmetrics/abingo.rb', line 212 def conversion_rate return 0 if participants == 0 1.0 * conversions / participants end |
#pretty_conversion_rate ⇒ Object
217 218 219 |
# File 'lib/sinmetrics/abingo.rb', line 217 def pretty_conversion_rate sprintf("%4.2f%%", conversion_rate * 100) end |