From: "ara.t.howard" Date: 2008-08-14T00:57:39+09:00 Subject: Re: truncate float to 2 decimals On Aug 13, 2008, at 9:47 AM, Junkone wrote: > how do i truncate the float to 2 decimals > > irb(#):001:0> f=0.911501706632285 > => 0.911501706632285 just use the normal math way cfp:~ > cat a.rb float = 0.911501706632285 puts( Integer(float * 100) / Float(100) ) cfp:~ > ruby a.rb 0.91 a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama