| [ Index ] |
|
Code source de Symfony 1.0.0 |
1 <?php 2 3 /* 4 * This file is part of the symfony package. 5 * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> 6 * 7 * For the full copyright and license information, please view the LICENSE 8 * file that was distributed with this source code. 9 */ 10 11 /** 12 * NumberHelper. 13 * 14 * @package symfony 15 * @subpackage helper 16 * @author Fabien Potencier <fabien.potencier@symfony-project.com> 17 * @version SVN: $Id: NumberHelper.php 3495 2007-02-18 09:30:24Z fabien $ 18 */ 19 20 function format_number($number, $culture = null) 21 { 22 if (is_null($number)) 23 { 24 return null; 25 } 26 27 $numberFormat = new sfNumberFormat(_current_language($culture)); 28 29 return $numberFormat->format($number); 30 } 31 32 function format_currency($amount, $currency = null, $culture = null) 33 { 34 if (is_null($amount)) 35 { 36 return null; 37 } 38 39 $numberFormat = new sfNumberFormat(_current_language($culture)); 40 41 return $numberFormat->format($amount, 'c', $currency); 42 } 43 44 function _current_language($culture) 45 { 46 return $culture ? $culture : sfContext::getInstance()->getUser()->getCulture(); 47 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Fri Mar 16 22:42:14 2007 | par Balluche grâce à PHPXref 0.7 |