developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Ticket #1206: tpl.modifier.round.diff

File tpl.modifier.round.diff, 781 bytes (added by Vincentv, 10 years ago)
  • new file lib/jelix/plugins/tpl/common/modifier.round.php

    diff -r 6a70404299bf lib/jelix/plugins/tpl/common/modifier.round.php
    - +  
     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/**
     11 * Modifier plugin : Rounds a float
     12 *
     13 * <pre>
     14 *  {$var|round:2}
     15 * </pre>
     16 * @param float $val the value to round
     17 * @param int $precision The number of decimal digits to round to.
     18 * @return float
     19 */
     20function jtpl_modifier_common_round($val, $precision = 0) {
     21    return round($val, $precision);
     22}
     23
     24