Octavian Rasnita wrote:
Hi,
Please tell me if it is possible to test if 2 numbers are equal and if 2
strings are the same using Template-Toolkit.
(I want to be able to use == and eq also).
If it is not possible directly, is there a workaround?
Thank you.
Teddy
I do not believe it's possible to use both. Here's an example that shows you a
work around, though:
[% num1 = 5 %]
[% string1 = '05' %]
'[% num1 == string1 %]' gives ''<br>
'[% 5 == 05 %]' gives '1'
'[% num1+0 == string1+0 %]' gives '1'<br> [%# <-- Work around %]
-- Josh
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates