I'm having a rough day, but something is not adding up correctly.
In my C# code, I have this:
Math.Ceiling((decimal)(this.TotalRecordCount / this.PageSize))
Where (int)TotalRecordCount
= 12 and (int)PageSize
= 5. The result I am getting is 2.
(Both values are int
values.)
By my calculations, 12 / 5 = 2.4. I thought Math.Ceiling would always round up, and in this case, give me 3?
PS, if I do this:
Math.Ceiling(this.TotalRecordCount / this.PageSize)
I get the message:
Math.Ceiling(this.TotalRecordCount / this.PageSize)
The call is ambiguous between the following methods or properties:
'System.Math.Ceiling(decimal)' and 'System.Math.Ceiling(double)'