Craig White wrote:
> On Mon, 2009-09-28 at 01:52 +0800, Mohit Sindhwani wrote:
>   
>> Craig White wrote:
>>     
>>>>     
>>>>         
>>> ----
>>> you can easily create your own function and put it into application.rb
>>> or the helper
>>>
>>> myvar < 10 ? "0" + myvar.to_s : myvar.to_s
>>>
>>> it must be a string to retain the leading zero
>>>       
>> or "%02d" % myvar
>>     
> ----
> ok - you win
>
> Craig
>   

Hardly :)  I just use that a lot!!  A lot of  my work involves data 
conversion and when outputting it, sending out 7 or 10 decimal places 
looks clumsy.  So, it's short hand that I've become accustomed to writing :)

Cheers,
Mohit.
9/28/2009 | 11:48 AM.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to