Matthew Knott

Previous: Load A CSS File For A Specific SharePoint Webpart On The Fly With CssRegistration
Next: SharePoint URL Functions

Rounding up in C#

Posted on Tuesday, 02 June 2009 10:40

A quick post about rounding up in C#. To round up, you simply use the Math.Ceiling method.

double a = 3;
double b = 7;
double c = Math.Ceiling((double)b / a);

The output of this calculation would be 3, not 2.5.

Comments

No comments have been added.

Add a comment