Reputation: 52047
I want to round TheCount / 5
to the next highest integer. When TheCount = 12
I tried:
Math.round(TheCount / 5);
but it returns 2 and I need it to return 3.
How does rounding to the next highest integer work?
Thanks.
Upvotes: 0
Views: 175
Reputation: 66
rather than Math.round you want Math.ceil
So you'd want
var result = Math.ceil(TheCount / 5);
Hope that helps!
Upvotes: 1