2009/4/22 Paul A. <cyril.staff / gmail.com>:
> I would like to display numbers with a 0 before when there is only one
> char.
> For exemple if I gets the number 4, I would like to return 04.
>
> After looking methods on
> http://www.ruby-doc.org/core/classes/Fixnum.html, I don't see how to
> process. Of cours it is possible to convert a number into string and
> after add a 0, but it's not very friendly.

Please look up sprintf, printf and String#%.

Cheers

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/