new modifier: number_format
| From: | Paul Ardeleanu | Date: | Wed, 04 Aug 2004 13:00:33 +0000 |
| Subject: | new modifier: number_format | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-11660@lists.php.net to get a copy of this message | ||
Hi all!
May I submit for addition a new modifier? I've write it in order to
display number in english notation.
Here it is:
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty number_format modifier plugin
*
* Type: modifier<br>
* Name: number_format<br>
* Purpose: format number via number_format
* @link
http://smarty.php.net/manual/en/language.modifier.number.format.php
* number_format (Smarty online manual)
* @param float
* @param int
* @param string
* @param string
* @return string
*/
function smarty_modifier_number_format($number, $decimals=2,
$dec_point='.', $thousands_sep='')
{
return number_format($number, $decimals, $dec_point, $thousands_sep);
}
/* vim: set expandtab: */
?>
Thanks,
Paul
___________________________________________________________ALL-NEW Yahoo! Messenger - all new
features - even more fun! http://uk.messenger.yahoo.com