ASP.net MVC 5 C# returning the double from within IF statement -


how access double within if statement

 [httppost]     public actionresult iflexcst([optional] float quan, [optional] float kammid, [optional] float kammod, [optional] float spacerinnerdim, [optional] float spacerouterdim, [optional] float washouterdim, [optional]float isowashinnerdim, [optional]float steelwashinnerdim, [optional] float steelwashquan, [optional] float isowashquan, formcollection form)     {         //other functions removed         if (washouterdim <= 43.6)         {              double washerserrtime = 0.6;             double serrwasherrun = (washerserrtime * isowashquan) * (1 / 60);             viewbag.serrwasherrun = serrwasherrun;              double serrwasherrunprice = ((serratesetup / quan) + washerserrtime) * serraterate;             viewbag.serrwasherrunprice = serrwasherrunprice;          }          if (washouterdim > 43.6)         {               double washerserrtime = 0.833;             double serrwasherrun = (washerserrtime * isowashquan) * (1 / 60);             viewbag.serrwasherrun = serrwasherrun;              double serrwasherrunprice = ((serratesetup / quan) + washerserrtime) * serraterate;             viewbag.serrwasherrunprice = serrwasherrunprice;           }           // adds costs          float price = (float)serrwasherrunprice; 

it recommends creating getting , setting "serrwasherrunprice" or making public variable, both these solutions give me conflicts declaration.

because store on viewbag times can take there, in way don't have change code much.

// adds costs  float price = (float)viewbag.serrwasherrunprice; 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -