首先需要說明的是:不是所有人的網站都會出現這個錯誤,只有符合一定環境和條件的網站才有可能出現這類錯誤提示,如下:
Warning: number_format() expects parameter 1 to be double, string given in D:/www/includes/lib_common.php on line 945
只有滿足下述這兩個條件時,個別頁面才會出現number_format()錯誤提示。
1)PHP版本為5.3.0及以上版本
2)配送方式免費額度為0
那么要如何來解決呢,下面就說一下解決辦法:
在includes/lib_common.php中找到:
else
{
$price = number_format($price, 2, '.', '');
}
修改為
else
{
if(!$price){
$price = 0;
}
$price = number_format($price, 2, '.', '');
}
新聞熱點
疑難解答