FLOOR

The FLOOR function rounds a number down to the nearest significant multiple (toward minus infinity).

Syntax

FLOOR(
    number,
    significance
)

Parameters
  • number: Number to be rounded.
  • significance: Multiple to which the indicated number will be rounded.
Returned value

The FLOOR function returns the number (integer or real) rounded to the nearest multiple of significance in the direction of minus infinity. If number is in currency format, the function returns a number in the same format.

Additional Information

The FLOOR function considers the number to be rounded and returns the multiple of significance that is closest to number and is less than or equal to it. For example, the function applied to the number 3.71 with the significance argument 0.05, returns the multiple of 0.05 that is closest to 3.71 that is less than or equal to this number. That is, it returns 3.7:

FLOOR function. Example of use

"Less", in this context, means tending to minus infinity (that is, for a negative value it means further from zero).

Logically, if significance takes the value 1, the result will be the integer closest to number that is less than or equal to it:

FLOOR function. Example of use

If significance takes the value 2, the result will always be a multiple of this figure:

FLOOR function. Example of use

If significance is zero, the function will return an error message. If significance is True, it is considered a value of 1 for this argument, and if it is False, it is considered a value of 0 (which causes an error, as already mentioned).

If number is a positive value, significance must be a number greater than zero. On the contrary, if number is a negative value, significance can be both positive and negative. If positive, number will be rounded to minus infinity. If it is negative, it will be rounded to plus infinity.

Examples

The following example shows the price of several products rounded to the nearest multiple of € 0.5 less than or equal to each of them:

FLOOR function. Example of use

Related functions
Category
Mathematical and trigonometric
Submitted by admin on Tue, 12/04/2018 - 12:33