Zend 货币上的数字格式

发布于 2024-12-28 17:37:26 字数 277 浏览 5 评论 0原文

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

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

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

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沩ん囻菔务 2025-01-04 17:37:26

尝试将 number_format 更改为 格式

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

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文