I am developing a web application using asp.net c#. In that I need to get the percentage of Time. I am not getting the correct way to accomplish this. I have TotalHours which is coming from db. I need to calculate the 80% of that TotalHours.
Help will be appreciated. Thanks...
//This is how I am getting the TotalTime
TimeSpan TotalTime = TimeSpan.Parse(totalhours);
if(TotalTime != null)
{
TimeSpan Percentage= ( TotalTime* 80 ) / 100;
// here I need to get correct percentage in hrs
// If TotalTime is 10 hrs then Percentage should be 8 hrs
}