/lib/jelix/plugins/tpl/common/modifier.round.php
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
- <?php
- /**
- * @package jelix
- * @subpackage jtpl_plugin
- * @author Vincent Viaud
- * @copyright 2010 Vincent Viaud
- * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html
- */
- /**
- * Modifier plugin : Rounds a float
- *
- * <pre>
- * {$var|round:2}
- * </pre>
- * @param float $val the value to round
- * @param int $precision The number of decimal digits to round to.
- * @return float
- */
- function jtpl_modifier_common_round($val, $precision = 0) {
- return round($val, $precision);
- }