【发布时间】:2011-01-21 07:53:27
【问题描述】:
我需要帮助计算:
我需要这样做:
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
我刚才解释的功能的任何特定或预制代码?
有什么想法吗?
【问题讨论】:
-
"乘以 qty * rate 和输入的总和" - 有点模棱两可。
-
除了简单的算术之外,我在这里看不到任何东西。你试过什么了?哪里出了问题?
-
SALES TAX (0.07) or (0.7%)应该是(7.0%)?
标签: javascript invoice