PageRenderTime 42ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://bitbucket.org/jelix/jelix-trunk/
PHP | 24 lines | 4 code | 3 blank | 17 comment | 0 complexity | 60690792af6c537c59624bcef9b8ce0d MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, BSD-3-Clause, JSON, GPL-3.0, LGPL-3.0
  1. <?php
  2. /**
  3. * @package jelix
  4. * @subpackage jtpl_plugin
  5. * @author Vincent Viaud
  6. * @copyright 2010 Vincent Viaud
  7. * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html
  8. */
  9. /**
  10. * Modifier plugin : Rounds a float
  11. *
  12. * <pre>
  13. * {$var|round:2}
  14. * </pre>
  15. * @param float $val the value to round
  16. * @param int $precision The number of decimal digits to round to.
  17. * @return float
  18. */
  19. function jtpl_modifier_common_round($val, $precision = 0) {
  20. return round($val, $precision);
  21. }