Hello:
I have four columns:
item = xx
unit price = 55.00
quantity = 30
extended price = 1,650.00 (unit price * quantity)
The subtotal (which adds the total column) should appear as 1,650.00. Instead, the number I’m getting is 1.00.
The subtotal number prints correctly up to 999.99. As soon as it reaches a 1,000 and higher as in my case 1,650.00, my number prints 1.00 leaving out the 650 part.
I’m not sure why. I hope someone can help.
Here’s what I did with my code:
First, I set my $subtotal = 0;
Second, for my total price I’m using the following calculation:
$extprice = number_format($price * $qty, 2);
Third, I wrote a calculation which adds the extended price to a subtotal before taxes:
$subtotal = $extprice + $subtotal;
Finally, I want to print the $total which appears as such:
[code]
<tr>
<td colspan=”3″ align=”right”>Subtotal:</td>
<td align=”right”> <?php echo number_format($subtotal, 2); ?></td>
Can someone help me out?
Thanks.