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 #875: 875-number_format.diff

File 875-number_format.diff, 2.9 KB (added by Surfoo, 12 years ago)
  • lib/jelix/plugins/tpl/common/modifier.number_format.php

     
    2020 * @param string $thousands_sep the separator string for the thousands
    2121 * @return string
    2222 */
    23 function jtpl_modifier_common_number_format($number, $decimals=0, $dec_point='.', $thousands_sep=','){
     23function jtpl_modifier_common_number_format($number, $decimals=0, $dec_point=false, $thousands_sep=false){
     24    if ($dec_point == false) {
     25        $dec_point = jLocale::get('jelix~format.decimal_point');
     26    }
     27    if ($thousands_sep == false) {
     28        $thousands_sep = jLocale::get('jelix~format.thousands_sep');
     29    }
    2430    return number_format($number, $decimals, $dec_point, $thousands_sep);
    2531}
  • lib/jelix/core-modules/jelix/locales/en_EN/format.UTF-8.properties

     
    1111format.monetary = £ %d
    1212
    1313decimal_point   = .
    14 thousands_sep   = \w
     14thousands_sep   = ,
    1515
    1616int_curr_symbol = GBP       #International currency symbol (i.e. USD)
    1717currency_symbol = £         #Local currency symbol (i.e. $)
  • lib/jelix/core-modules/jelix/locales/en_US/format.UTF-8.properties

     
    1111format.monetary = $ %d
    1212
    1313decimal_point   = .
    14 thousands_sep   = \w
     14thousands_sep   = ,
    1515
    1616int_curr_symbol = USD       #International currency symbol (i.e. USD)
    1717currency_symbol = $         #Local currency symbol (i.e. $)
  • lib/jelix/core-modules/jelix/locales/fr_FR/format.UTF-8.properties

     
    1010
    1111format.monetary = %d EURO
    1212
    13 decimal_point   = .
     13decimal_point   = ,
    1414thousands_sep   = \w
    1515
    1616int_curr_symbol = EUR       #International currency symbol (i.e. USD)
  • lib/jelix/CREDITS

     
    217217Baptiste Toinot (aka Surfoo)
    218218 - double / in path for locale selector
    219219 - fixed little bugs in jForms (#789, #790)
     220 - little improvement in number_format modifier (#875)
    220221 
    221222Christian Tritten
    222223 - improvements on pagelinks plugin (#340)