I am having trouble rounding a number in C#. Here is my code:
public static double GetHighTargetHR (string birthdate, string examDate)
{
double HighTargetHR = 0;
double age;
double constant = 220;
age = CalculateAge(birthdate, examDate);
if (age > 0)
{
HighTargetHR = ((constant - age) * 0.8);
Math.Round(HighTargetHR, 0, MidpointRounding.AwayFromZero);
}
return HighTargetHR;
}
This patient's age is 26. So 220-26 = 194 * 0.8 = 155.20
I want the code to return 155. No matter what I change on the Math.Round function, it returns 155.20. How can I make it return an even number?