ZF-11798: Zend_Currency constructor overwrites the display option if a locale defines a symbol
Description
For a locale which defines a currency symbol, it's completely useless to define the display option because the constructor overwrites it with the Zend_Currency::USE_SYMBOL constant.
// Get the format
if (!empty($this->_options['symbol'])) {
$this->_options['display'] = self::USE_SYMBOL;
}
So the following code doesn't work:
$currency = new Zend_Currency(array('value' => 100, 'display' => Zend_Currency::USE_SHORTNAME), 'de_DE');
print $currency;
Because this code prints always the currency symbol €.
Comments
Posted by Adam Lundrigan (adamlundrigan) on 2011-10-28T19:05:00.000+0000
Reproducing unit test case (against locale en_US for convenience):
Result:
Posted by Adam Lundrigan (adamlundrigan) on 2011-10-28T19:10:12.000+0000
YMMV, but this fixes the issue for me. I have to do more research before i'm comfortable suggesting it as a complete fix and free of BC implications:
Posted by Adam Lundrigan (adamlundrigan) on 2012-06-01T00:14:27.000+0000
Fixed in trunk (1.12.0): r24855