【问题标题】:number format on Zend CurrencyZend Currency 上的数字格式
【发布时间】:2012-01-24 03:45:43
【问题描述】:

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

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

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

【问题讨论】:

    标签: zend-framework zend-currency


    【解决方案1】:

    尝试将 number_format 更改为 format

    Zend_Currency Docs 中关于 options array('format' =>'#0.00') 的摘录:
    format:定义格式 应该用于显示数字。此数字格式包括 例如千位分隔符。您可以通过以下方式使用默认格式 提供区域设置标识符,或手动定义数字格式。如果 没有设置格式 Zend_Currency 对象的语言环境将是 用过。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-12
      • 1970-01-01
      • 2013-07-16
      • 2015-08-03
      • 1970-01-01
      相关资源
      最近更新 更多