[Omaha.pm] TT algebra, format

Jay Hannah jhannah at omnihotels.com
Fri Aug 26 11:38:20 PDT 2005


I was just asked how to do algebra and format stuff in Template Toolkit.

Here's the example I gave him. I think it's valid. It may be one-linerable but I've learned not to struggle to compress TT syntax nearly as much as I compress my Perl...

j


[% a = b / 2;
   a = a | format('0.2f');
%]



More information about the Omaha-pm mailing list