Method: FatCore::Numeric#int_if_whole
- Defined in:
- lib/fat_core/numeric.rb
permalink #int_if_whole ⇒ Numeric, Integer
Return an Integer type, but only if the fractional part of self is zero; otherwise just return self.
120 121 122 |
# File 'lib/fat_core/numeric.rb', line 120 def int_if_whole whole? ? floor : self end |