PHP show money_format without currency text

后端 未结 3 1766
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-07 03:03

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?

Currently, I use:



        
相关标签:
3条回答
  • 2021-02-07 03:10

    !

    Seriously. that's the flag:

    $money = money_format("%!n", $money);
    
    0 讨论(0)
  • 2021-02-07 03:12
    // 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 讨论(0)
  • 2021-02-07 03:13

    try number_format($money)

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

    0 讨论(0)
提交回复
热议问题