number_format should be standard smarty modifier
| From: | Zoran Knezevic | Date: | Fri, 08 Oct 2004 12:22:36 +0000 |
| Subject: | number_format should be standard smarty modifier | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-11861@lists.php.net to get a copy of this message | ||
<?php
/*
* Smarty plugin
*
-------------------------------------------------------------
* File: modifier.number_format.php
* Type: modifier
* Name: number_format
* Purpose: Format a number with grouped thousands
*
-------------------------------------------------------------
*/
function smarty_modifier_number_format($string, $a = 2,
$b = \'.\',$c = \',\')
{
return number_format($string,$a,$b,$c);
}
?>
I use this modifier to format numbers that I get from
database or calculations in the php. This is pure
presentation thing that is why I think this should be
part of standard smarty modifiers.
Best regards,
Zoran Knezevic