module Gemmy::Patches::FloatPatch::InstanceMethods::RoundTo

Public Instance Methods

round_to( n ) click to toggle source

facets i.e. 2.046.round_to(0.01) == 2.05

# File lib/gemmy/patches/float_patch.rb, line 9
def round_to( n ) #n=1
  return self if n == 0
  (self * (1.0 / n)).round.to_f / (1.0 / n)
end