How to multiply in the View? Or have best Practices? Project - car rental. My controller takes parameter int numberDays. I need to calculate the total price on View for all days . Need multiply the price in one day the number of days. And then this parameter must be passed in the form of a controller.
public ActionResult DayView(int numberDays)
{
//
}
In View in foreach I display numbercar,colorcar and other...
@model IEnumerable<Car>
foreach (Car car in Model)
{
//other parameters
<p>Full Price</p>:Model.CostOneDay //need multiply numberDays
}
How <p>Full Price</p>:@(car.CostOneDay * Model.NumberOfDays)
this parameter add in hiddenfor , I need pass this form to controller