Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
HTML
<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:

HTML
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))
Posted
Updated 15-Sep-17 12:59pm
v2

1 solution

You know
x + x / 100 * 6 = x * 1.06
 
Share this answer
 
Comments
Afzaal Ahmad Zeeshan 15-Sep-17 16:10pm    
Then they say, Mathematics is not important in computer programming; 5ed.
CPallini 16-Sep-17 10:44am    
Thank you very much.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900