From: Steven Thomas Date: 2001-10-26T07:24:58+09:00 Subject: [ruby-talk:23366] Re: prog help Thanks, that works. Can't believe I didn't think of that. Steven Thomas Tech Support Delta County School District sthomas@delta.k12.co.us -----Original Message----- From: David Alan Black [mailto:dblack@candle.superlink.net] Sent: Thursday, October 25, 2001 4:01 PM To: ruby-talk ML Subject: [ruby-talk:23365] Re: prog help Hello -- On Fri, 26 Oct 2001, Steven Thomas wrote: > How can I get a float to round to the hundredth 0.009 -> 0.01? Pending an answer from someone who knows what they're doing with float manipulation... would something like this be sufficient? irb 3> class Float; def to_hund; (self * 100.0).round / 100.0 end; end ==>nil irb 4> 0.009.to_hund ==>0.01 David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav