HELP CALCULATING INVOICE
===

I need help with a calculation: 

I need to to this: 

Item ---- Qty ( 2  )  --- Rate ( $2  )   = Total (  $4  )
Item ---- Qty ( 3  )  --- Rate ( $3  )   = Total (  $9  )


SUBTOTAL  = $13
SALES TAX (0.07) or (0.7%) = $0.91
TOTAL = $13.91

in code..


my pseudocode is: 

Multiply qty * rate and input in total

subtotal = sum of item totals

sales tax = 0.07 * subtotal 

total = sum of subtotal and sales tax




any specific or pre-made code for the function I have just explained? 


any ideas?