首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >PHP显示不带货币文本的money_format

PHP显示不带货币文本的money_format
EN

Stack Overflow用户
提问于 2011-07-06 02:29:09
回答 3查看 22.9K关注 0票数 22

在PHP中,是否可以使用money_format显示货币而不显示货币,或者至少以缩写形式显示货币?

目前,我使用:

代码语言:javascript
复制
$money = "1234.56";
setlocale("LC_ALL", "de_DE");
$money = money_format("%n", $money);
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2011-07-06 02:31:12

好了!

我是认真的。这就是标志:

代码语言:javascript
复制
$money = money_format("%!n", $money);
票数 47
EN

Stack Overflow用户

发布于 2011-07-06 02:31:20

票数 5
EN

Stack Overflow用户

发布于 2017-08-19 13:42:20

代码语言:javascript
复制
// this if for Malaysia  , you can check according to your locality

$number = new NumberFormatter($locale = 'ms_MS.utf8', NumberFormatter::DECIMAL);
    echo $nmuber->format($amount)."\n"; ## 20,00,00,00,000
// if this give error 
Class 'NumberFormatter' not found
// for this  you can do  you can do a
apt-get install php7.0-intl
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6587179

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档