original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Format an amount using the currency template
  @param int|float $amount
  @param array $data
  @return string
docstring_tokens: Format an amount using the currency template