0

How should I round up a number in c#?

I tried number += (1 - ( number % 1 )) ; But doesnt work for whole numbers.

11th Jan 2020, 8:28 AM
Mehran.S
2 Respostas
+ 2
Smart logic.. BTW for whole numbers means how? Can give example? Is you want it without use of round, ceil functions..? Math.Ceiling (number) ; //rounds up value....
11th Jan 2020, 9:31 AM
Jayakrishna 🇮🇳