views:

22

answers:

2

In it's default setup, the currency format for German Euro is "#,##0.00 ¤" which displays something like "750,00 €". I want to skip the decimal places to have the display "750€". When I change the currency format to "0 ¤" the €-symbol is not being displayed.

Is this a bug oder what am I doing wrong?

A: 

According to the documentation, you can call the Zend_Currency setFormat method, which accepts an array of parameters, one of which is 'precision'. Set the precision parameter to 0 and it shouldn't have any decimal places.

http://framework.zend.com/manual/en/zend.currency.options.html

Bob Baddeley
A: 

Magento has hardcoded the decimal places to 2 in Mage_Directory_Model_Currency

public function format($price, $options=array(), $includeContainer = true, $addBrackets = false)
{
  return $this->formatPrecision($price, 2, $options, $includeContainer, $addBrackets);
}

So I just wrote a small module which makes the hardcoded 2 configurable in the backend.

Thomas