PageRenderTime 60ms CodeModel.GetById 34ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/jelix/plugins/tpl/common/modifier.number_format.php

https://bitbucket.org/doubleface/jelix-jpu
PHP | 25 lines | 4 code | 1 blank | 20 comment | 0 complexity | fd0b1e0015e99076eff62c75baf79583 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1
  1. <?php
  2. /**
  3. * jTpl plugin that wraps PHP number_format function
  4. * @package jelix
  5. * @subpackage jtpl_plugin
  6. * @author Julien Issler
  7. * @contributor
  8. * @copyright 2008 Julien Issler
  9. * @link http://www.jelix.org
  10. * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html
  11. * @since 1.1
  12. */
  13. /**
  14. * NumberFormat plugin for jTpl that wraps PHP number_format function
  15. *
  16. * @param float $number the number to format
  17. * @param int $decimals the number of decimals to return
  18. * @param string $dec_point the separator string for the decimals
  19. * @param string $thousands_sep the separator string for the thousands
  20. * @return string
  21. */
  22. function jtpl_modifier_common_number_format($number, $decimals=0, $dec_point='.', $thousands_sep=','){
  23. return number_format($number, $decimals, $dec_point, $thousands_sep);
  24. }