title: ASP.NET MVC calculating Shipping total
body: <p>How do I calculate the shipping total in razor html. Shipping charges are $3.99 for the first item and $.99 for each additional item. </p>
  
  <pre><code> @{
       double itemTotal = 0;
       double subTotal = 0;
       int totalQty = 0;
       double discount = 0.8;
       double shippingBase = 3.99;
       double shippingItem = 0.99;
  
   }
  
      @foreach (var item in Model)
      {
  
          double price = (double)item.price / 100 * discount;
          itemTotal = @item.qty * price;
          subTotal += itemTotal;
          totalQty += @item.qty;
  </code></pre>