Re: Add a zero on single digit numbers
by Timothy Hunter other posts by this author
Nov 18 2006 5:10PM messages near this date
Re: Add a zero on single digit numbers
|
Ruby vs Java vs c++
mind2motion@[...].com wrote:
> Using DateTime.now.min I often get single digit numbers like "7".
> However "22:7" isn't really adequate for displaying time properly; I
> want "22:07".
>
> Is there any way add a 0 onto the front of a Fixnum?
>
> I understand I could convert it into a string and add a zero onto the
> front of that string, but that's not really ideal.
>
>
check out DateTime#strftime.
Thread:
mind2motion
Ben Bleything
Timothy Hunter
|