虚位以待(AD)
虚位以待(AD)
首页 > CMS教程 > Ecshop > ecshop页面出现number_format错误的解决办法

ecshop页面出现number_format错误的解决办法
类别:Ecshop   作者:码皇   来源:互联网   点击:

不是所有人的ecshop网站都会出现这个错误,只有符合一定环境和条件的网站才有可能出现这类错误提示,如下:Warning: number_format() expects parameter 1 to be double, string given in D:wwwincludeslib_comm ,魔客吧

不是所有人的ecshop网站都会出现这个错误,只有符合一定环境和条件的网站才有可能出现这类错误提示,如下:

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

只有满足下述这两个条件时,个别页面才会出现number_format()错误提示。

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

那么要如何来解决呢,下面就说一下解决办法,在includeslib_common.php中找到:

else{ $price = number_format($price, 2, '.', '');}

修改为

else { if(!$price){ $price = 0; } $price = number_format($price, 2, '.', '');}
相关热词搜索: ecshop页面出现number_format错误的解决办