C# Decimal Ceiling
Description
Decimal Ceiling
returns the smallest integral value
that is greater than or equal to the specified decimal number.
Syntax
Decimal.Ceiling
has the following syntax.
public static decimal Ceiling(
decimal d
)
Parameters
Decimal.Ceiling
has the following parameters.
d
- A decimal number.
Returns
Decimal.Ceiling
method returns The smallest integral value that is greater than or equal to the d parameter.
Note that this method returns a Decimal instead of an integral type.
Example
The following example illustrates the Ceiling method.
/* ww w .j a v a 2 s . c o m*/
using System;
public class Example
{
public static void Main()
{
Console.WriteLine(Decimal.Ceiling(-3.9m));
Console.WriteLine(Decimal.Ceiling(3.9m));
}
}
The code above generates the following result.