José Carlos
José Carlos

Reputation: 1015

number format on Zend Currency

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?

Upvotes: 0

Views: 1395

Answers (1)

drew010
drew010

Reputation: 69967

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.

Upvotes: 2

Related Questions