Look at the overload list for Math.Round
. There are two methods taking a single parameter:
double Round(double d)
decimal Round(decimal d)
Both are applicable when called with an int
argument - but it's pointless to call the method when you've only got an int
to start with, as it's already rounded.
I suspect you actually want to change how you're doing arithmetic, e.g. by performing the division operation in double
arithmetic, which will then propagate to the other operations:
// Note the 4095.0 to make it a double
Math.Round((2000-((Splots[x].RawMin/4095.0)*2000))+200);
Without that, all the operations use integer arithmetic, which almost certainly wasn't what you wanted.
You'll still need to cast the result to int
though. The range of double
exceeds that of both int
and long
, which is why the return type of Math.Round(double)
is double
. In this case you "know" that the result will be in an appropriate range though, given the calculation.