From: "Jan E." Date: 2012-10-19T08:12:10+09:00 Subject: Re: Truncate number which ends with 0 decimal Joao Silva wrote in post #1080345: > This code works fine when the decimal ends in zero, but if the decimal > number ends in another, round it, and that's not what I want. Just make the precision 3 and cut off the last character: p format('%.3f', 2345.5876374536).chop p format('%.3f', 2345.5).chop -- Posted via http://www.ruby-forum.com/.