From: Roger Pack Date: 2011-09-15T02:39:50+09:00 Subject: Re: How do I make output generate a float without an excess numbers of decimal places? > In 1.8.x, round() simply rounded to nearest integer. > > http://www.ruby-doc.org/core-1.8.7/classes/Float.html#M000650 > > You should update to Ruby 1.9.2. or define your own round method class Float def round2 n "%.#{n}f" % self end end >> 1.11111.round2(2) => "1.11" -- Posted via http://www.ruby-forum.com/.