number format on Zend Currency

1.3k Views Asked by At

I am developing a site Zend based but I have the followin problem:

$currency = new Zend_Currency();
$currency->toCurrency(20, array('currency' => 'EUR','number_format' => '#0.#'));

Gives me 20,00 EUR but I need 20.00 EUR (that is why i set number_format), Any suggestion?

1

There are 1 best solutions below

0
On

Try changing number_format to just format.

Excerpt from Zend_Currency Docs in reference to the options array('format' =>'#0.00'):
format: Defines the format which should be used for displaying numbers. This number-format includes for example the thousand separator. You can either use a default format by giving a locale identifier, or define the number-format manually. If no format is set the locale from the Zend_Currency object will be used.