Mono Class Library: System.Decimal Overview | Members

System.Decimal.Floor Method

Rounds a decimal value to the closest integer towards negative infinity. [Edit]

public static decimal Floor (decimal d)

Parameters

d
The decimal to round downward. [Edit]

Returns

A decimal value v such that v is an integer and d - 1 < v <= d . The scale of the result will be zero. [Edit]

Remarks

Documentation for this section has not yet been entered. [Edit]

Example

The following example demonstrates the decimal.Floor(decimal) method.

C# Example
using System;
class DecimalTest {
 public static void Main() {
   Console.WriteLine("floor {0} is {1}", 3.14159m, Decimal.Floor(3.14159m));
   Console.WriteLine("floor {0} is {1}", -3.9m, Decimal.Floor(-3.9m));
   Console.WriteLine("floor {0} is {1}", 3.0m, Decimal.Floor(3.0m));
 }
}

The output is

floor 3.14159 is 3
floor -3.9 is -4
floor 3.0 is 3

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0