Subversion-Projekte lars-tiefland.php_share

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

<?php
    /*
    * Smarty plugin
    *
    -------------------------------------------------------------
    * File:     modifier.money_format.php
    * Type:     modifier
    * Name:     money_format
    * Version:  1.0
    * Date:     Feb 8th, 2003
    * Purpose:  pass value to PHP money_format() and return result
    * Install:  Drop into the plugin directory.
    * Author:   Michael L. Fladischer <mfladischer@abis.co.at>
    *
    -------------------------------------------------------------
    */
    function smarty_modifier_money_format( $string, $places = 2 )
    {
        if ( !isset( $_SESSION["locale"] ) )
        {
            $_SESSION["locale"] = "de_DE";
        }
        setlocale( LC_MONETARY, $_SESSION["locale"] );
        return money_format( "%.{$places}i", $string );
    }

    /* vim: set expandtab: */
?>