Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.10.5
-
Fix Version/s: 1.10.7
-
Component/s: Zend_Currency
-
Labels:None
Description
Hi,
i'm trying to use Zend_Currency connected with exchange.
Where its implemented its works correctly. But i thing it needs more usability.
1.
firstly
protected function _exchangeCurrency($value, $currency)
Convert currency only from foreign to my currency.
2.
public function getValue() should have param
public function getValue($currency), and return exchange value with correct format
3.
public function __toString()
public function toString()
public function toCurrency($value = null, array $options = array())
don't use exchange at all
ps
1.) _exchangeCurrency is an internal method. There is no need to change it's behaviour and to corrupt Zend_Currency.
2.) getValue() returns the internal value of the currency... it does not calculate nor does it normalize. This is a plain float value without any additional informations like currencies or notations.
3.) toCurrency() returns the informations for the ACTUAL currency object. It does not change or exchange anything. Note that it is not possible to exchange the OWN object.
You can not exchange a currency from A to B and then from B to A with the same value. Credit institutes always wants to have a exchange-fee. Therefor you must give the exchange rate always for each direction independently.