Home

Published

- 1 min read

number_format() expects parameter 1 to be float, string given

img of number_format() expects parameter 1 to be float, string given

The solution for this is noted below

number_format() expects parameter 1 to be float, string given

Solution

   $tot_tapas = float($number_of_persons) * float($tapas);
$tot_tapas = number_format((float)$tot_tapas , 2, '.', '');

Try other methods by searching on the site. That is if this doesn’t work