bukwus Posted January 27, 2012 Share Posted January 27, 2012 Hello I'm getting the following error: number_format() expects parameter 1 to be double, string given in file path on line 118 And this is what's on line 118: $_SESSION['dataValue3'] = number_format($dataValue[3]); Any help would be greatly appreciated. Andy Quote Link to comment https://forums.phpfreaks.com/topic/255899-number_format-error/ Share on other sites More sharing options...
AyKay47 Posted January 27, 2012 Share Posted January 27, 2012 to help you with this, we would need to see what value $dataValue[3] holds. however, doing it blindly, if the string is numeric, this should work. $_SESSION['dataValue3'] = number_format((float)$dataValue[3]); Quote Link to comment https://forums.phpfreaks.com/topic/255899-number_format-error/#findComment-1311800 Share on other sites More sharing options...
Pikachu2000 Posted January 27, 2012 Share Posted January 27, 2012 Before you blindly start casting things as different data types, post the output of var_dump($dataValue[3]);. Quote Link to comment https://forums.phpfreaks.com/topic/255899-number_format-error/#findComment-1311806 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.