0

我正在开发一个基于 Zend 的网站,但我有以下问题:

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

给我20,00 EUR,但我需要20.00 EUR(这就是我设置 number_format 的原因),有什么建议吗?

4

1 回答 1

2

尝试更改number_format为仅format

摘自 Zend_Currency Docs 参考选项 array('format' =>'#0.00')
format:定义应该用于显示数字的格式。这种数字格式包括例如千位分隔符。您可以通过提供区域设置标识符来使用默认格式,也可以手动定义数字格式。如果没有设置格式,将使用 Zend_Currency 对象的语言环境。

于 2012-01-24T04:06:24.470 回答