我需要帮助计算:
我需要这样做:
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
在代码中。
我的伪代码是:
Multiply qty * rate and input in total
subtotal = sum of item totals
sales tax = 0.07 * subtotal
total = sum of subtotal and sales tax
我刚刚解释的功能的任何特定或预制代码?
有任何想法吗?