From: "ara.t.howard" Date: 2008-07-02T07:14:08+09:00 Subject: Re: Is posible String#to_s doesn't add the decimal value if not needed? On Jul 1, 2008, at 4:09 PM, Iņaki Baz Castillo wrote: > Hi, I want to convert a string to a Float value: > > irb> "1.5".to_f > => 1.5 > > But if I do: > > irb> "1".to_f > => 1.0 > > I get '1.0' instead of just '1'. Is not possible to just get '1' in > this case? > > Thanks a lot. > > > -- > Iņaki Baz Castillo > n = Integer(n) rescue Float(n) 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