Search code examples
c#asp.netasp.net-mvc-2drop-down-menu

Percentage calculation


I am working in progress bar concept in ASP.NET MVC 2. Here i have a DropDownList which has 10 values. i want to calculate the percentage for progress bar, e.g. 10 values from DropDownList and i am having a query which returns the value 2. so, out of 10 values i am getting 2. "20 % completed" should be displayed.. How to do this calculation


Solution

  • (current / maximum) * 100. In your case, (2 / 10) * 100.