Class: Float

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

Overview

extend classes with extra methods

Instance Method Summary collapse

Instance Method Details

#round_to(d = 2) ⇒ Object



3
4
5
6
7
# File 'lib/scbi_math/float_extras.rb', line 3

def round_to(d = 2)

  res = (self*10.0*d).round/(10.0*d)
  return res
end