original_string: public function formatCurrency($value, $currency)
      {
          if (self::DECIMAL == $this->style) {
              return $this->format($value);
          }
  
          $symbol = Currencies::getSymbol($currency, 'en');
          $fractionDigits = Currencies::getFractionDigits($currency);
  
          $value = $this->roundCurrency($value, $currency);
  
          $negative = false;
          if (0 > $value) {
              $negative = true;
              $value *= -1;
          }
  
          $value = $this->formatNumber($value, $fractionDigits);
  
          // There's a non-breaking space after the currency code (i.e. CRC 100), but not if the currency has a symbol (i.e. £100).
          $ret = $symbol.(mb_strlen($symbol, 'UTF-8') > 2 ? "\xc2\xa0" : '').$value;
  
          return $negative ? '-'.$ret : $ret;
      }
code: public function formatCurrency($value, $currency)
      {
          if (self::DECIMAL == $this->style) {
              return $this->format($value);
          }
  
          $symbol = Currencies::getSymbol($currency, 'en');
          $fractionDigits = Currencies::getFractionDigits($currency);
  
          $value = $this->roundCurrency($value, $currency);
  
          $negative = false;
          if (0 > $value) {
              $negative = true;
              $value *= -1;
          }
  
          $value = $this->formatNumber($value, $fractionDigits);
  
          // There's a non-breaking space after the currency code (i.e. CRC 100), but not if the currency has a symbol (i.e. £100).
          $ret = $symbol.(mb_strlen($symbol, 'UTF-8') > 2 ? "\xc2\xa0" : '').$value;
  
          return $negative ? '-'.$ret : $ret;
      }
code_tokens: public function formatCurrency ( $ value , $ currency ) { if ( self :: DECIMAL == $ this -> style ) { return $ this -> format ( $ value ) ; } $ symbol = Currencies :: getSymbol ( $ currency , 'en' ) ; $ fractionDigits = Currencies :: getFractionDigits ( $ currency ) ; $ value = $ this -> roundCurrency ( $ value , $ currency ) ; $ negative = false ; if ( 0 > $ value ) { $ negative = true ; $ value *= - 1 ; } $ value = $ this -> formatNumber ( $ value , $ fractionDigits ) ; // There's a non-breaking space after the currency code (i.e. CRC 100), but not if the currency has a symbol (i.e. £100). $ ret = $ symbol . ( mb_strlen ( $ symbol , 'UTF-8' ) > 2 ? "\xc2\xa0" : '' ) . $ value ; return $ negative ? '-' . $ ret : $ ret ; }
docstring: Format a currency value.
  
  @param float  $value    The numeric currency value
  @param string $currency The 3-letter ISO 4217 currency code indicating the currency to use
  
  @return string The formatted currency value
  
  @see http://www.php.net/manual/en/numberformatter.formatcurrency.php
  @see https://en.wikipedia.org/wiki/ISO_4217#Active_codes
docstring_tokens: Format a currency value .