Code:
{math equation="(sub_total+discount+shipping_cost)*0.02"
sub_total=$cart.sub_total
discount=$cart.discount
shipping_cost=$cart.shipping_cost
assign="surcharge"
format="%.2f"}
You need it to be of that form which was stated above.
You have to assign the variables for the math equation for smarty to use them.
[/code]