Ceiling Function |
System.Math
Math.Ceiling( a )
A Double containing the smallest integer greater than or equal to the argument a
Returns the smallest integer greater than or equal to the argument a
Console.WriteLine(Math.Ceiling(12.1)) ' Returns 13 Console.WriteLine(Math.Ceiling(12.5)) ' Returns 13 Console.WriteLine(Math.Ceiling(-12.5)) ' Returns -12 Console.WriteLine(Math.Ceiling(-12.8)) ' Returns -12
Because this function can accept only numeric values, you may want to check the value you pass using the IsNumeric function to prevent generating an error.
This is a Shared member, so it can be used without creating any objects.
The Ceiling function is new to the .NET Framework.
Floor Function