2
I am using this formatting so that the total returns me the correct value. But this line returns me without the pennies. The value has to return for example: 23.99 and is returning 23.00.
How to solve ?
$total = number_format($total,2, ',' , '.');
echo '<tr>
<td colspan="5">TOTAL</td>
<td><hr> '.$total.' </td>
</tr>';
The
$total
has that content ? If it’s a matter of decimal being a,
then is duplicate of many others that already have here on the site.– Isac
This is the total content: $total += number_format ($line["Unit"] * $Qtd, 2, ',' , '.');
– xavier
Also include the code before this one. What you’ve posted so far has no way of knowing the problem.
– Andrei Coelho
Put a
var_dump($total); exit;
before this code and see if$total
really has decimal part.– Woss