James Edward Gray II wrote:
> On Oct 31, 2005, at 4:47 PM, i.v.r. wrote:
>
>> Hi,
>>
>> This seems like a simple task, yet I've been unable to accomplish it. 
>> Somewhere I read you could do:
>>
>> num.round(2).to_s("F")
>>
>> But that is not working, as the round method doesn't accept any 
>> parameters.
>>
>> Could someone help me figure this out?
>
> >> sprintf("%.2f", 1.012345)
> => "1.01"
> >> # ... or ...
> ?> "%.2f" % 1.012345
> => "1.01"
>
> Hope that helps.
>
> James Edward Gray II
>
>
That was fast! Thanks a lot.