0
$newprice = (round(floatval(trim(str_replace('$','',$mrow[3])))*.75), 2);

Works fine as a floatvar without the round() part, but says there is an expected comma when I try to round to two decimals.

Looks correct per the docs.. "echo round(1.95583, 2); // 1.96"

Anyone see the issue here?

Edit:

$newprice = (round(floatval(trim(str_replace('$','',$mrow[3])))*.75));

Works fine, but I need two decimal places.

PHP 7.0.5-2

some1
  • 1,547
  • 8
  • 26
  • 45

1 Answers1

1

PHP 7.0.5-2

No need for trim as floatval will take care of it

$newprice = round(floatval(str_replace('$','',$mrow))*.75, 2);
cpugourou
  • 775
  • 7
  • 11