Sorry,

'%03d'%n

00n

'%02d'%n

0n

http://stackoverflow.com/questions/134934/display-number-with-leading-zeros

Richard

On Thu, Oct 20, 2011 at 3:17 PM, Richard Vézina <[email protected]
> wrote:

>
> Try
> '%002d'%n
>
> Richard
>
>
> On Thu, Oct 20, 2011 at 2:43 PM, Vinicius Assef <[email protected]>wrote:
>
>> Hi guys,
>> I'm facing a little problem here.
>>
>> In my view I have:
>> {{n=3}}
>> {{='%2d' % n}}
>>
>> This shows the number " 3" (a space before the number 3). I expected
>> it shows "03" (a leading zero).
>>
>> Is it the way it should work?
>> I think variable interpolation should mantain its contents when
>> printed to the user.
>>
>> Anybody know why this is happening?
>>
>> --
>> Vinicius Assef.
>>
>
>

Reply via email to