Re: [SMARTY] new modifier: number_format
| From: | boots | Date: | Wed, 04 Aug 2004 15:50:51 +0000 |
| Subject: | Re: [SMARTY] new modifier: number_format | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11661@lists.php.net to get a copy of this message | ||
--- Paul Ardeleanu <pardeleanu@yahoo.com> wrote:
> Hi all!
> May I submit for addition a new modifier? I've write it in order to
> display number in english notation.
FYI: Strictly, this isn't necessary as you can use PHP functions as
modifiers and this one is wrapping the PHP function 1:1.
xo boots
> 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
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>