if you need to show the discount amount then you do need to do more than that anyway. Example:
$qty = 3;
$price = 100.25;
$disc_percent = 5 / 100; // or assign as .05
$extended_price = $price * $qty; // Price multiplied by quantity
$discount = round($extended_price * $disc_percent, 2); // Round discount
$disc_price = $extended_price - $discount; // Discounted price before tax + shipping
echo '$qty = ', $qty, '<br>';
echo '$price = ', $price, '<br>';
echo '$disc_percent = ', $disc_percent, '<br><br>';
echo '$extended_price = ', $extended_price, '<br>';
echo '$discount = ', $discount, '<br>';
echo '$disc_price = ', $disc_price, '<br>';
The above would output something like:
$qty = 3
$price = 100.25
$disc_percent = 0.05
$extended_price = 300.75
$discount = 15.04
$disc_price = 285.71