[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] TT algebra, format



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');
%]