Class: Float

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_helper/float/trim.rb

Instance Method Summary collapse

Instance Method Details

#trimObject



4
5
6
7
8
# File 'lib/simple_helper/float/trim.rb', line 4

def trim
  i = to_i
  f = to_f
  i == f ? i : f.round(1)
end