Round decimal to Ceiling in CSharp
Description
The following code shows how to round decimal to Ceiling.
Example
/* ww w . j a va 2 s. co m*/
using System;
class DecCompareEqualsDemo
{
public static void Main( )
{
decimal[] values = {12.6m, 12.1m, 5.5m, 8.56m, .1m, -5.1m, -5.9m};
foreach (decimal value in values)
Console.WriteLine("{0} -> {1}", value, Decimal.Ceiling(value));
}
}
The code above generates the following result.