<div class="meta" robots="noindex">

</div>

Method

# Xojo.Math.Floor

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2020r2. Please use `Floor</api/math/floor>` as a replacement.

</div>

## Description

Returns the value rounded down to the nearest whole number.

## Sample code

The <span class="title-ref">Floor</span> of a decimal number:

``` xojo
Using Xojo.Math

Dim d As Double
d = Floor(1.234) ' d = 1
```

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Because <span class="title-ref">Floor</span> will always return a whole number, to round a decimal value to a certain number of places, you must first multiple the number by 10^(the number of decimal places to which you wish to round) then take the value returned by <span class="title-ref">Floor</span> of that number and divide it by 10^(the number of decimal places to which you wish to round). In this example, the value 1.2345 is being rounded to two decimal places:

``` xojo
Dim d As Double
d = Xojo.Math.Floor(1.234 * 100) / 100 
```

## Compatibility

All project types on all supported operating systems.
