Module: Darthjee::CoreExt::Numeric
- Included in:
- Numeric
- Defined in:
- lib/darthjee/core_ext/numeric.rb
Instance Method Summary collapse
Instance Method Details
#percent_of(total) ⇒ Object
6 7 8 9 |
# File 'lib/darthjee/core_ext/numeric.rb', line 6 def percent_of(total) return Float::INFINITY if total&.zero? (to_f / total.to_f) * 100.0 end |