Warning: number_format () expects parameter 1 to be double

I get Warning: number_format() expects parameter 1 to be double errorin my code

$tbl->addRow();
$tbl->addCell($name);
$tbl->addCell('$' . number_format(doubleval($price), 2,',', ' ') );

I know that the price of $ value is a value of 15.00, which is a number. How can this be fixed?

+4
source share
1 answer

Perhaps doubleval () returns some kind of error, because the number "15.00" is in the European format instead of the standard one. Have you tried using "15.00" instead?

+1
source

All Articles