From: Jeppe Jakobsen Date: 2006-02-19T05:36:58+09:00 Subject: convert each element in an array ------=_Part_8458_29458218.1140295004261 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Thanks! 2006/2/18, Logan Capaldo : > > > On Feb 18, 2006, at 12:53 PM, Jeppe Jakobsen wrote: > > > Hi, I can't find out how to convert each integer in my array to a > > float. > > I've tried: > > > > array.each {|x| x.to_f} > > > > But it did not work. > > > > Can anyone tell me the correct method? > > > > -- > > "winners never quit, quitters never win" > > array.map! { |x| x.to_f } # for in place modification > array2 =3D array.map { |x| x.to_f } # if you want a new array with > float values without messing up the old array > > > > -- "winners never quit, quitters never win" ------=_Part_8458_29458218.1140295004261--