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



317
318
319
320
321
# File 'lib/kronk/player/benchmark.rb', line 317

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