![]() |
Arithmetic operators produce no result with variables
I am trying to re-format the invoice/order email and am using a html table to contrl the layout.
When I try to get a line total, however, I cannot get the product of the qty and price variables. My code at the moment: <td width=15%><font face="Arial" size=2>({$products[prod_num].price} * {$products[prod_num].amount})</font></td> This produces a result like: (14.95 * 10) instead of the desired result 149.50 I have tried many variations on the PHP syntax but can't get anything to work. Enclosing this formula with <? ... ?> only yields a blank. What am I missing? Would greatly appreciate some help. Thanks Greg |
<td width=15%><font face="Arial" size=2>({math equation="x * y" x=$products[prod_num].price y=$products[prod_num].amount format="%.2f"})</font></td>
That should do it. "format="%.2f"" simply keeps the decimel places to two, in case you were wondering. So output should be 149.50. |
MAD, your blood's worth bottling!!!
Worked a treat - thanks heaps. :D |
All times are GMT -8. The time now is 11:34 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.