From: James Edward Gray II Date: 2005-10-02T00:50:04+09:00 Subject: Re: Truncating Floats On Oct 1, 2005, at 4:31 AM, Kero wrote: >> Probably cause you can do it in one line: >> >> ('%.2f' % 0.255).to_f >> > > That's rounding, not truncating. Okay, how about: 0.255.to_s.sub(/(\.\d{2})\d+/, "\\1").to_f James Edward Gray II