From: Edmond Kachale Date: 2010-09-21T20:41:51+09:00 Subject: Re: Dividing a number into individual digits --0015175cd13ea6d6570490c383c8 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 2010/9/21 Timothy Baron > Here's a simple question: What's an effecient way to get the digits of > a number. For instance, if I have the number 37, how can I get "3" and > "7"? > I'm not sure about the efficiency but this can do: number.to_s.split(//) Ex: 1464002.to_s.split(//) =3D> ["1", "4", "6", "4", "0", "0", "2"] Otherwise, you may need to derive a method of your own. :-) --- Edmond Software Developer | Baobab Health Trust (http://www.baobabhealth.org/) | Malawi Cell: +265 999 465 137 | +265 881 234 717 *"Many people doubt open source software and probably don=92t realize that there is an alternative=85 which is just as good.." -- Kevin Scannell* --0015175cd13ea6d6570490c383c8--