Class: Float

Inherits:
Object
  • Object
show all
Defined in:
lib/kronk/player/benchmark.rb

Instance Method Summary collapse

Instance Method Details

#round(ndigits = 0) ⇒ Object



303
304
305
306
307
# File 'lib/kronk/player/benchmark.rb', line 303

def round ndigits=0
  num, dec = self.to_s.split(".")
  num = "#{num}.#{dec[0,ndigits]}".sub(/\.$/, "")
  Float num
end