how do i round up a variaible? im doing a paging system and need to divdie the list size by the list total. However if its an odd number you need another page. how can i round the variable up so?
Probabbly really simple but it escapes me at the moment.
Rounding up a variable
hi all,
how do i round up a variaible? im doing a paging system and need to divdie the list size by the list total. However if its an odd number you need another page. how can i round the variable up so?
Probabbly really simple but it escapes me at the moment.
Cheers
Ive tried
var amountOfPages = listTotal / listSize;
var amountofPagesRounded = (int)System.Math.Ceiling((double)amountOfPages);
but it still produces the figure rounded down.
eg listTotal is 5 and listsize is 2 should be 2.5 rounded to 3 but it produces 2?
Any help is aprectaited.
Hi,
:-)
Works like a dream cheers
is working on a reply...