Possible Duplicate:
How to Round Up The Result Of Integer Division
double d1=11, double d2=2
int i=d1/d2;
i would be 5. But I would like it to return 6. (if the result is 5.01, I would want a 6 too) How should I do it?
int i = (int)Math.Ceiling(d1/d2);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With