Class: Float

Inherits:
Object
  • Object
show all
Defined in:
lib/rubychem_rspec.rb

Instance Method Summary collapse

Instance Method Details

#round_to(x) ⇒ Object



48
49
50
# File 'lib/rubychem_rspec.rb', line 48

def round_to(x)
  (self * 10**x).round.to_f / 10**x
end