1

How to I round a decimal upwards to the nearest int.

i.e.

1.2 ---> 2
5.6 ---> 6
79.9 ---> 80
85.01 ---> 86

(int)Math.Round(count / (decimal)rows, MidpointRounding.AwayFromZero)

mellamokb
  • 55,194
  • 12
  • 105
  • 134
Kris-I
  • 18,550
  • 52
  • 145
  • 228

1 Answers1

12

Math.Ceiling is your friend

spender
  • 112,247
  • 30
  • 221
  • 334