Tyraziel has asked for the wisdom of the Perl Monks concerning the following question:
I have been playing around with Template::Toolkit for some time now and I have run into the need of currency formatting. I currently have a commafy display function (the code for that I found here :-D) that I am using in my Template and I tried using the format filters that come with Template::Toolkit to add decimal places to the number, but it appears that it only effects the output.
It would be ideal to have a solution that I can format the number and then commafy it via Template::Toolkit and not have to inject perl code (which I'm doing now via sprintf.) I have a couple of ideas on how to do this and I am seeking wisdom on the best approach.
Any suggestions on how to get this done the right and correct way would be greatly appreciated. Thank you for your time.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Template Toolkit Formatting Data Question (sprintf and commafy)
by jeffa (Bishop) on Jul 13, 2005 at 14:57 UTC | |
by Tyraziel (Novice) on Jul 13, 2005 at 15:33 UTC | |
by Anonymous Monk on Dec 09, 2011 at 08:25 UTC |