This method is used to round the decimal to the closest integer toward negative infinity.
Syntax: public static decimal Floor (decimal d);
d: This parameter specifies the decimal which will be rounded off.
Return Value: If d has a fractional part, the next whole Decimal number toward negative infinity that is less than d or d doesn’t have a fractional part, d is returned unchanged. Note that the method returns an integral value of type Decimal.
Below programs illustrate the use of Decimal.Floor(Decimal) Method:
Floor Value is : 4
Floor Value is : -6
Floor Value is : 2
- Difference between Method Overriding and Method Hiding in C#
- C# | Insert() Method
- C# | Replace() Method
- C# | Clone() Method
- Decimal.Add() Method in C#
- C# | Math.Log() Method
- Stack.Pop() Method in C#
- C# | ToCharArray() Method
- C# | Random.Next() Method
- C# | IsNullOrWhiteSpace() Method
- Stack.Contains() Method in C#
- C# | PadRight() Method
- C# | Uri.ToString() Method
- C# | Uri.IsWellFormedOriginalString() Method
- C# | EndsWith() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.