...I have no idea where you would put it in your code. If you are placing this just somewhere on your page you can put it anywhere before the page renders and then just do this on your page:
(Remember to format it as currency)
Alternatively, you could simply write a query to figure the total for you. The query language would be something like:
SELECT Sum(priceColumn) from table [where clause]
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
Read this if you want to know how to get a correct reply for your question:
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^