如何从总额中获得税额? [英] how to get tax amount from grand total?
本文介绍了如何从总额中获得税额?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,我的总税额和税额为%。现在我想用C#显示税号。
i我在获取实际价值时遇到小错误。
这是我的代码。
decimal GrandTotal = 240 。 35 ;
decimal Taxfactor = 15 ;
十进制 taxamount = grandtotal - ((grandtotal * taxfactor)/ 100);
但是税金额
值给我36.0525,实际税额应该是31.35。
因为实际数据是小计= 209加税15%给出240.35。
i知道这是因为我计算了Grandtotal的税率,但我不知道应该在哪里修改。
解决方案
< blockquote> Total = nett *((100 + rate)/ 100);
Tax = Total *(rate /(100 + rate));
ok我自己解决了这个问题
这里是代码。
decimal GrandTotal = 240 。 35 ;
decimal Taxfactor = 15 ;
decimal taxamount = grandtotal - ((grandtotal * 100)/ 100 + Taxfactor);
hi all , i have grand total and tax amount in %. now i want to show the tax value in number using C#.
i am getting small errors in getting actual values.
here is my code .
decimal GrandTotal = 240.35;
decimal Taxfactor =15 ;
decimal taxamount= grandtotal - ((grandtotal * taxfactor)/100);
but taxamount
value gives me 36.0525 and actual tax amount should be 31.35.
coz what real data is subtotal = 209 plus tax 15% which gives 240.35.
i know it is because i calculate tax percentage on grandtotal but i dont know where i should modified.
解决方案
Total = nett * ((100 + rate) / 100);
Tax = Total * (rate / (100 + rate));
ok i have solve this my self
here is the code.
decimal GrandTotal = 240.35; decimal Taxfactor =15 ; decimal taxamount=grandtotal - ((grandtotal *100)/100+Taxfactor );
这篇关于如何从总额中获得税额?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文