开发者

PHP show money_format without currency text

开发者 https://www.devze.com 2023-03-18 17:34 出处:网络
In PHP, is it possible to use money_format to display money without showing the开发者_如何学Go currency or at least showing it in an abbreviated form?

In PHP, is it possible to use money_format to display money without showing the开发者_如何学Go currency or at least showing it in an abbreviated form?

Currently, I use:

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


!

Seriously. that's the flag:

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


try number_format($money)

http://php.net/manual/en/function.number-format.php


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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号