Beispiel #1
0
 /**
  * Convenience method
  * call $this->formatDate() in the view to access 
  * the helper
  *
  * @access public
  * @return string
  */
 public function formatAmount($amount, $currencyIso = NULL)
 {
     $formattedAmount = new Zend_Currency();
     $formattedAmount->setValue($amount);
     if (!is_null($currencyIso)) {
         switch ($currencyIso) {
             case 'EUR':
                 $locale = 'es_ES';
                 break;
             case 'GBP':
                 $locale = 'en_GB';
                 break;
             default:
                 $locale = 'en_US';
                 break;
         }
         $formattedAmount->setLocale($locale);
     }
     return $formattedAmount;
 }
Beispiel #2
0
 /**
  * @param string $locale
  */
 public function setLocale($locale)
 {
     $this->locale = $locale;
     $this->currencyLib->setLocale($locale);
 }
 public function setLocale($locale = null)
 {
     $this->_locale = $locale;
     parent::setLocale($locale);
     return $this;
 }