我需要计算税款和折扣。以下是我正在使用的公式,但查询返回的结果很短。为什么这些总计不匹配
((8.75+0)/100)*(50.00*1 - (50*1*.1/100)) as test,
的MySQL retuens 4.370625,当我做数学题(0.0875 * 50 - 0.05),计算器,我得到:3.875
我要去哪里错了?
让我们这个现实世界的例子
A single item for sale:
Quantity: 1.00
Price: $20.00
Tax: 8.75%
Discount: 10%
The tax should equal: $1.58
The subtotal without tax is $18.00
Total: $19.58 (after the discount and tax added)
如何编写查询,以获得税收和单独计算获得折扣?
eumiro,谢谢,我现在就给这个镜头。 – Jim 2011-02-03 14:47:12
eumiro,我完全搞清楚这个公式,老实说,我一直这样做太久了。你能帮我把计算税和折扣的栏放在一起吗? – Jim 2011-02-03 14:52:43