-2

this is my code but error is message : divison by zero

  <?php $percent = (($topsell->prodcut_price - $topsell->discount_price)*100) /$topsell->prodcut_price ;?>

1 Answers1

-2

Looks like you have made a mistake in:

$topsell->prodcut_price

maybe:

$topsell->product_price

Anyway, check variable if it equal to zero before dividing on it.