Function Math Reals Class

Floor

Floor of a real number. Number vNumber is rounded-down with precision vPrecision.

Signature (Visual Basic / VBA)

Public Function Floor( _
      ByVal vNumber As Variant _
    , Optional ByVal vPrecision As Variant _
    ) As Variant

Code Example

    Floor(2.4) = 2
    Floor(2) = 2
    Floor(.6) = 0
    Floor(0) = 0
    Floor(-.6) = -1
    Floor(-2) = -2
    Floor(-2.4) = -3
    Floor(-1.4, .5) = -1.5
    Floor(-1.7, .5) = -2

Parameters

Parameter Description
vNumber The number that is to be rounded-down. Function returns Null if vNumber is Null or cannot be fixed up to a number.
vPrecision The precision used when rounding vNumber. vPrecision defaults to 1 (one) if it is missing or Null or cannot be fixed up to a number.

Notes & Version History

Note The IntReal function is a more specific version of Floor.
Note With a precision of 1 (one), function returns the largest integer less than or equal to vNumber, which is equivalent to the IntReal function.