广州传奇网络

地址:广州市天河区东圃大马路富华楼C座

电话:13808825895

邮箱:gz020wbs@163.com

QQ:1564443073

网址:http://www.020wbs.com/

首页 > 二次开发Ecshop二次开发 > ecshop中报number_format() expects parameter 1 to be double警告的解决办法

二次开发Ecshop二次开发

二次开发Ecshop二次开发

ecshop中报number_format() expects parameter 1 to be double警告的解决办法

 Warning: number_format() expects parameter 1 to be double, string given in \includes\lib_common.php on line 974 

Ecshop购物车确认页面出现number_format()错误的解决办法 

Warning: number_format() expects parameter 1 to be double,
一般在这种情况

1)PHP版本为5.3.0及以上版本
2)配送方式免费额度为0 

下时,才会出现number_format()错误提示。


Warning: number_format() expects parameter 1 to be double, string given in \includes\lib_common.php on line 945



那么要如何来解决呢,下面就说一下解决办法:

在includes\lib_common.php中找到price_format()函数把:

else
{
$price = number_format($price, 2, '.', '');
}
修改为
else 
{
$price = $price  ? number_format($price, 2, '.', ''):0;
}