class Float
  # round2 definition as before

  def roundf2(places)
    shift = 10**places
    (self * shift).round2 / shift.to_f
  end
end

a = 6.125
b = 6.135
x = a.roundf2(a)   # 6.12
y = b.roundf2(b)   # 6.13

