There is no standard method which will round up all numbers identically:
123.99 -> 124
124.00 -> 124
124.01 -> 125
The Math.Round method will round to the nearest integer, or to an odd or even number - but it won't round the way you want it to.
You would have to write your own method which checks the fractional part of the value and applies the rounding for you.
But ... that's some odd code.
int numbers = rn.Next(0, 200);
double doubleValue = decimal.ToDouble(numbers);
Every value will be a "nnn.00" value because the
numbers
value is an integer. And why are you using a
decimal
conversion to change an
int
to a
double
?
I think that getting the rounding right is the least of your problems here ... :laugh: