I think the problem here is you still need the original String#to_f
method, which you have not duplicated. You're better off creating a new
method for this; perhaps "to_f_truncate" which then calls the unmodified
to_f and modifies the results.
It's also a very bad idea to modify such an essential core class like
that. Better to make your own subclass and use that, or make a method
within a specific scope so you don't destroy the behaviour of everything
sharing the same runtime environment. You'd probably be surprised how
often to_f is used in the underlying components of your program.