cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2: A non well formed numeric value encountered

Magento 2: A non well formed numeric value encountered

I am getting this error. A non-well formed numeric value encountered in

/Magento_Catalog/templates/product/list.phtml on line 197

using this code on list.phtml

 

round($productPrice / $areaprsqft, 2);

Does anyone have a solution for this?

Thanks

 

1 REPLY 1

Re: Magento 2: A non well formed numeric value encountered

Hi @Shiwani Miglani ,

Please verify once $productPrice and $areaprsqft variable value.

echo number_format(50/4.5, 2);

OR

echo round(50/4.5, 2);

Working fine. 

TRY ONCE: 

echo number_format($productPrice / $areaprsqft, 2);