ecshop页面出现number_format错误的解决办法
发布时间:12/03 来源: 浏览:
关键词:
不是所有人的ecshop网站都会出现这个错误,只有符合一定环境和条件的网站才有可能出现这类错误提示,如下:
Warning: number_format() expects parameter 1 to be double, string given in D:wwwincludeslib_common.php on line 945
只有满足下述这两个条件时,个别页面才会出现number_format()错误提示。
- PHP版本为5.3.0及以上版本
- 配送方式免费额度为0
那么要如何来解决呢,下面就说一下解决办法,在includeslib_common.php中找到:
else { $price = number_format($price, 2, '.', ''); }
修改为
else { if(!$price){ $price = 0; } $price = number_format($price, 2, '.', ''); }