public function formatTemplate($amount, array $data)
    {
        $placeholders = array();

        foreach (array_keys($data) as $key) {
            $placeholders["%$key"] = $key;
        }

        $formatted = gplcart_string_replace($data['template'], $placeholders, $data);
        return $amount < 0 ? "-$formatted" : $formatted;
    }
public function formatTemplate($amount, array $data)
    {
        $placeholders = array();

        foreach (array_keys($data) as $key) {
            $placeholders["%$key"] = $key;
        }

        $formatted = gplcart_string_replace($data['template'], $placeholders, $data);
        return $amount < 0 ? "-$formatted" : $formatted;
    }
public function formatTemplate ( $ amount , array $ data ) { $ placeholders = array ( ) ; foreach ( array_keys ( $ data ) as $ key ) { $ placeholders [ "%$key" ] = $ key ; } $ formatted = gplcart_string_replace ( $ data [ 'template' ] , $ placeholders , $ data ) ; return $ amount < 0 ? "-$formatted" : $ formatted ; }
Format an amount using the currency template
@param int|float $amount
@param array $data
@return string
Format an amount using the currency template