Re: [SMARTY] numeric formats
| From: | messju mohr | Date: | Thu, 22 Apr 2004 07:28:44 +0000 |
| Subject: | Re: [SMARTY] numeric formats | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11299@lists.php.net to get a copy of this message | ||
On Thu, Apr 22, 2004 at 12:26:20AM -0700, Robby Russell wrote:
> If I send 7, 7.00 or 7.0 to a template, how can I have smarty display it
> as 7.00 regardless?
{$number|string_format:"%.2f"}
or, if you don't like sprintf, maybe:
{$number|number_format:2}
i prefer the former.
greetings
messju
> -Robby