Floor Method (Decimal)
Collapse the table of content
Expand the table of content

Math.Floor Method (Decimal)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Returns the largest integer less than or equal to the specified decimal number.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public static decimal Floor(
	decimal d
)

Parameters

d
Type: System.Decimal
A decimal number.

Return Value

Type: System.Decimal
The largest integer less than or equal to d.

The behavior of this method follows IEEE Standard 754, section 4. This kind of rounding is sometimes called rounding toward negative infinity. In other words, if d is positive, any fractional component is truncated. If d is negative, the presence of any fractional component causes it to be rounded to the smaller integer. The operation of this method differs from the Ceiling method, which supports rounding toward positive infinity.

The following example illustrates the Math.Floor(Decimal) method and contrasts it with the Ceiling(Decimal) method.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft