Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1371 lars 1
<?php
2
    /*
3
    * Smarty plugin
4
    *
5
    -------------------------------------------------------------
6
    * File:     modifier.number_format.php
7
    * Type:     modifier
8
    * Name:     number_format
9
    * Version:  1.0
10
    * Date:     May 1st, 2002
11
    * Purpose:  pass value to PHP number_format() and return result
12
    * Install:  Drop into the plugin directory.
13
    * Author:   Jason E. Sweat <jsweat_php@yahoo.com>
14
    *
15
    -------------------------------------------------------------
16
    */
17
    function smarty_modifier_number_format_locale( $string, $places = 2 )
18
    {
19
        if ( !isset( $_SESSION["locale"] ) )
20
        {
21
            $_SESSION["locale"] = "de_DE";
22
        }
23
        switch ( $_SESSION["locale"] )
24
        {
25
            case "de_DE":
26
                $dpoint = ",";
27
                $thousand = ".";
28
                break;
29
            case "en_US":
30
            default:
31
                $dpoint = ".";
32
                $thousand = ",";
33
                break;
34
        }
35
        return number_format( $string, $places, $dpoint, $thousand );
36
    }
37
 
38
    /* vim: set expandtab: */
39
?>