From: Kero Date: 2005-10-01T18:31:45+09:00 Subject: Re: Truncating Floats > Probably cause you can do it in one line: > > ('%.2f' % 0.255).to_f That's rounding, not truncating. For some purposes, there's BigDecimal, where x.yz is really two decimals (and not an approximation as a flost takes) And behold! BigDecimal#floor takes an argument, the number of digits you want (had to look that up myself; learn something new every day :) +--- Kero ------------------------- kero@chello@nl ---+ | all the meaningless and empty words I spoke | | Promises -- The Cranberries | +--- M38c --- http://members.chello.nl/k.vangelder ---+