Prestashop 用小数点显示价格,但保留0(预设值)
我在一个.php文件中获得了价格,代码如下:Prestashop 用小数点显示价格,但保留0(预设值),prestashop,Prestashop,我在一个.php文件中获得了价格,代码如下: Tools::ps_round((string)$prod->getPriceWithoutReduct(), 2); 我得到的例子是:59.4,但我需要59.40,我怎样才能做到呢 谢谢使用普通PHP number_format(Tools::ps_round((string)$prod->getPriceWithoutReduct(), 2), 2);
Tools::ps_round((string)$prod->getPriceWithoutReduct(), 2);
我得到的例子是:59.4,但我需要59.40,我怎样才能做到呢
谢谢使用普通PHP
number_format(Tools::ps_round((string)$prod->getPriceWithoutReduct(), 2), 2);