Class: Float

Inherits:
Object show all
Includes:
MinMaxComparison
Defined in:
lib/wdd-ruby-ext/numbers.rb

Instance Method Summary collapse

Methods included from MinMaxComparison

#max, #min

Instance Method Details

#precision(pre) ⇒ Object



33
34
35
36
# File 'lib/wdd-ruby-ext/numbers.rb', line 33

def precision(pre)
  mult = 10 ** pre
  (self * mult).truncate.to_f / mult
end