Link to home
Start Free TrialLog in
Avatar of breeze351
breeze351

asked on

Problems with a new error with number_format

I have code that did work.  Now I'm getting this error from the page:

Warning: number_format() expects parameter 1 to be double, string given in /home/mrbreeze/public_html/chris/Survey_Display.php on line 411

The code in the php is:
411:                  $work = number_format("$ROW[STORE]");
412:                  echo $work;
413:                  echo "<br>";

WTF?
Avatar of Gary
Gary
Flag of Ireland image

What is the value of $ROW[STORE]

Is STORE a variable? If not it should be like
$ROW['STORE']
Avatar of duncanb7
duncanb7

First try $work = number_format("$ROW[STORE]")
to be $work = number_format($ROW[STORE]);
If still not, probably, $ROW[STORE] array is  NOT matched to number of store, STORE constant, so you need to check the method how you save any data in $ROW[STORE]

If okay, please provide more code around data operation for $ROW[STORE]

Duncan
Could you print out $ROW[STORE] by print_r($ROW)  and echo count($ROW) in php
to see whether it is matched to STORE or not ?

Duncan
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial