Warning: A non-numeric value encountered?

Hi everyone after transferring my site to another hosting I get this error: (php 7.4 on both hosts) "Warning: A non-numeric value encountered in /htdocs/example.com/wp-content/themes/themename/woocommerce/taxonomy-product_cat.php on line 159"

the code on line 159 is the following:

     $  discount = round (intval($  sale_price  / $  regular_price ) * floatval (100)); 

where am i wrong?

Thanks for help me