> -----Original Message-----
> From: Nick Woolley [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, February 02, 2003 5:33 PM
> To: [EMAIL PROTECTED]
> Subject: [Templates] Searchable index of this mailinglist?
> 
> How can I convert '01' to 1?  
> Adding zero does not work.

Alright, maybe I missed a message in there, (and Randal's 
suggestion of using formats is still the best anyway,) but
why doesn't adding zero work?

It worked for me just fine. I use it every day in templates
on a customer site.

[% dt = '2000/01/06' %]
[% dt = dt.split('/') %]
[% IF dt.2+0 == 6 %]
[% dt.2 %] and 6 match when I add zero!
[% ELSE  %]
[% dt.2 %] and 6 don't match!
[% END  %]

Emits:
06 and 6 match when I add zero!

Thus the question, is there a trap waiting for me where this
will break?

--mark mills
Xodiax Engineering

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to