PHP 显示money_format 没有货币文本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6587179/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 00:47:56  来源:igfitidea点击:

PHP show money_format without currency text

phpmoney-format

提问by Frank Vilea

In PHP, is it possible to use money_format to display money without showing the currency or at least showing it in an abbreviated form?

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

Currently, I use:

目前,我使用:

$money = "1234.56";
setlocale("LC_ALL", "de_DE");
$money = money_format("%n", $money);

回答by cwallenpoole

!

Seriously. that's the flag:

严重地。那是旗帜:

$money = money_format("%!n", $money);

回答by rackemup420

回答by Manmeet Khurana

// 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