示例#1
0
 /**
  * Convenience method for formatting currency values
  *
  * @param float  $price
  * @param string $currencyCode (Optional)
  *
  * @return string
  */
 public function formatPrice($price, $currencyCode = null)
 {
     $options = array('precision' => 2, 'display' => Zend_Currency::NO_SYMBOL);
     if (Mage::helper('bronto_common')->useCurrencySymbol($this->getStore()->getId())) {
         unset($options['display']);
     }
     $currencyCode = $currencyCode ? $currencyCode : $this->getStore()->getDefaultCurrencyCode();
     if (is_null($this->_currency) || $this->_currency->getCode() != $currencyCode) {
         $this->_currency = Mage::getModel('directory/currency')->load($currencyCode);
     }
     return $this->_currency->formatTxt($price, $options);
 }