For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > August 2004 > Re: [SMARTY] new modifier: number_format









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] new modifier: number_format
Boots

2004-08-04, 4:02 pm

--- 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/lan...mber.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
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com