Possible Duplicate:
Built in .Net algorithm to round value up to the nearest 10 interval
HI, i need a Method that returns next number of the 5er row. example: 3 -> 5 7 -> 10 8 -> 10 16 ->20
how can i do that? thx
Possible Duplicate:
Built in .Net algorithm to round value up to the nearest 10 interval
HI, i need a Method that returns next number of the 5er row. example: 3 -> 5 7 -> 10 8 -> 10 16 ->20
how can i do that? thx
For positive values:
int rounded = 5 * Math.Ceiling( (double)original / 5 );
int rounded = original + (5 - original%5);