From: Robert Dober Date: 2007-01-29T16:36:35+09:00 Subject: Re: Question about digits ------=_Part_71891_19622530.1170056193362 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 1/29/07, Pe=F1a, Botp wrote: > > From: Fer# [mailto:fernando.mdelacueva@gmail.com] : > > # irb(main):003:0> (0...arbitrary_number.to_s.length).map{|digit| > # arbitrary_number.to_s.split('')[digit]} > # =3D> ["1","2","3"] > > forgive my ignorance, but why are you splitting them and rebuilding back > the array. I mean why not, > > # arbitrary_number.to_s.split '' > # =3D> ["1","2","3"] > > and it works for signed and float too > > # arbitrary_number=3D-123.45 > =3D> -123.45 > # arbitrary_number.to_s.split '' > =3D> ["-", "1", "2", "3", ".", "4", "5"] > > kind regards -botp that's what we did, yielding as was required, no? Cheers Robert --=20 "The best way to predict the future is to invent it." - Alan Kay ------=_Part_71891_19622530.1170056193362--