我想在查询的返回结果中添加6%的增量 [英] I want to add increment of 6% to the return result from the query

查看:85
本文介绍了我想在查询的返回结果中添加6%的增量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 <   td  >  Rs @(Model.lstItem.Sum(c => c._product.option!= null?(c._product.option.Price * c.Quantity):( c._product.product .Price * c.Quantity)) - (Model.coupon!= null?(int)Model.coupon.Discount:0))<   / td  >  





首先让我告诉你我在asp.net mvc中是全新的..现在我的问题是我有上面的查询,它是在价格和数量相乘后返回总数。现在我想要的是我想将价格的6%增加到价格数量。



最终结果将是(价格*数量)+价格的6% * quanity ..



i希望你们理解我的问题



我尝试过:



 Rs @(Model.lstItem.Sum(c => c._product.option!= null? (c._product.option.Price * c.Quantity +(c._product.option.Price * c.Quantity)/ 100 * 6):( c._product.product.Price * c.Quantity +(c._product。 option.Price * c.Quantity)/ 100 * 6)) - (Model.coupon!= null?(int)Model.coupon.Discount:0))

解决方案

你知道

 x + x / 100 * 6 = x * 1.06 


<td>Rs @(Model.lstItem.Sum(c => c._product.option != null ? (c._product.option.Price * c.Quantity) : (c._product.product.Price * c.Quantity))- (Model.coupon != null ? (int)Model.coupon.Discount : 0))</td>



first of all let me tell you i am totally new in asp.net mvc.. Now my question is i have the above query which is returning total after multiplying price and quantity. now what i want is i want to increment 6% of pricequantity to the pricequanity..

The final result will be like (price * quantity) + 6% of price * quanity..

i hope you guys understand my question

What I have tried:

Rs @(Model.lstItem.Sum(c => c._product.option != null ? (c._product.option.Price * c.Quantity + (c._product.option.Price * c.Quantity) / 100 * 6) : (c._product.product.Price * c.Quantity + (c._product.option.Price * c.Quantity) / 100 * 6))- (Model.coupon != null ? (int)Model.coupon.Discount : 0))

解决方案

You know

x + x / 100 * 6 = x * 1.06


这篇关于我想在查询的返回结果中添加6%的增量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆