Found an elegant solution:
int pageCount = (records + recordsPerPage - 1) / recordsPerPage;
Source: Number Conversion, Roland Backhouse, 2001
Related Posts:
- C# Java HashMap equivalent
- C# Java HashMap equivalent
- Is there an equivalent to the Scanner class in C# for strings?
- C# equivalent to Java’s charAt()?
- How can we prepend strings with StringBuilder?
- C++ performance vs. Java/C#
- Integer division in Java [duplicate]
- How can I parse JSON with C#?
- What is IP address ‘::1’?
- What is the yield keyword used for in C#?
- Join/Where with LINQ and Lambda
- C# compiler error: “not all code paths return a value”
- How to use SQLite in Visual Studio 2017?
- C# equivalent of C++ map
- The page was not displayed because the request entity is too large on IIS
- Export Pervasive to MySQL (C#)
- Why use the params keyword?
- What does plus equals(+=) operator means here?
- The request was aborted: Could not create SSL/TLS secure channel
- finding the maximum length of lists in c#
- The located assembly’s manifest definition does not match the assembly reference
- LEFT OUTER JOIN in LINQ
- OnTriggerEnter not working at Unity3D
- The requested resource does not support HTTP method ‘GET’
- How can I find a specific element in a List
? - Rename a file in C#
- What does mscorlib stand for?
- What is the best way to iterate over a dictionary?
- What is and how to fix System.TypeInitializationException error?
- How to move 2D Object with WASD in Unity
- The Object you want to instantiate is null. Unity 3D
- Convert date yyyyMMdd to system.datetime format
- How to bind a model to a kendo Combobox in order to use the models validatation?
- HttpWebRequest-The remote server returned an error: (400) Bad Request
- MSHTML DLL on Windows 10
- What is the best math library to use with java?
- Adding values to a C# array
- Adding values to a C# array
- What does {0} mean when found in a string in C#?
- How to use html.ValidationMessageFor
- EF 5 Enable-Migrations : No context type was found in the assembly
- What is the difference between “@Scripts.Render” and “
Recommended Hostings
Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.
FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.