C# Math Floor(Decimal)
Description
Math Floor(Decimal)
returns the largest integer less
than or equal to the specified decimal number.
Syntax
Math.Floor(Decimal)
has the following syntax.
public static decimal Floor(
decimal d
)
Parameters
Math.Floor(Decimal)
has the following parameters.
d
- A decimal number.
Returns
Math.Floor(Decimal)
method returns The largest integer less than or equal to d. Note that the method returns an
integral value of type Math.
Example
The following example illustrates the Math.Floor(Decimal) method and contrasts it with the Ceiling(Decimal) method.
using System;//from www. j av a 2s . c o m
public class MainClass{
public static void Main(String[] argv){
Console.WriteLine(Math.Floor(1.2M));
}
}
The code above generates the following result.