From: Yehuda Katz Date: 2009-02-24T05:13:14+09:00 Subject: [ruby-core:22384] Re: Proposal: Integer.digit_count --000e0cd28df22cc04a04639ba4a6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit What's the use-case for this being in the language? It's damn easy to write ruby-method for it: class Integer def digit_count to_s.size end end 2009/2/23 Varun Gupta > How about having a method to return number of digits in the Integer? > > eg. > > 36420.digit_count => 5 > > Regards, > Varun Gupta > -- Yehuda Katz Developer | Engine Yard (ph) 718.877.1325 --000e0cd28df22cc04a04639ba4a6 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable What's the use-case for this being in the language? It's damn easy = to write ruby-method for it:

class Integer
  def digit_count=
    to_s.size
  end
end

2009/2/23 Varun Gupta <thevarungupta@gmail.com>
How about having = a method to return number of digits in the Integer?

eg.

36420= .digit_count =3D> 5

Regards,
Varun Gupta



--
Yehuda Katz
D= eveloper | Engine Yard
(ph) 718.877.1325
--000e0cd28df22cc04a04639ba4a6--