StackApps calculate 2 columns

(Tim Oppenheim) #1


I need an easy way to do a calculation. I have column_price and column_quantity and I want to do a quick calculation to get a total price…and display it nicely.

StackApps is really doing what I need it to do, so I hope this is pretty simple.


(John Splashost) #2

This will do what you are after. Not sure if there is a better way with StackApps.

Change the Destination from Page to Variable and input a variable name with a $ prefix on both your price and quantity fields and then drop a HTML stack onto the page and paste in the following PHP code:


echo $column_price * $column_quantity;


Hope that helps.