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 #679: 679-jTpl-plugins-number_format-modifier.diff

File 679-jTpl-plugins-number_format-modifier.diff, 1.6 KB (added by Julien, 12 years ago)
  • build/manifests/jelix-lib.mn

     
    418418  modifier.date_format.php
    419419  modifier.indent.php
    420420  modifier.jdatetime.php
     421  modifier.number_format.php
    421422  modifier.regex_replace.php
    422423  modifier.replace.php
    423424  modifier.spacify.php
  • lib/jelix/plugins/tpl/common/modifier.number_format.php

     
     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/**
     15 * NumberFormat plugin for jTpl that wraps PHP number_format function
     16 *
     17 * @param float $number the number to format
     18 * @param int $decimals the number of decimals to return
     19 * @param string $dec_point the separator string for the decimals
     20 * @param string $thousands_sep the separator string for the thousands
     21 * @return string
     22 */
     23function jtpl_modifier_common_number_format($number, $decimals=0, $dec_point='.', $thousands_sep=','){
     24    return number_format($number, $decimals, $dec_point, $thousands_sep);
     25}