# Floor 脚本和图表功能

Floor() 将数值向下取整到通过 offset 数值偏移的 step 的最接近倍数。

与 ceil 函数比较，此函数对输入数值向上取整。

语法：

Floor(x[, step[, offset]])

返回数据类型： 数字

参数：

参数

| 参数 | 描述 |
| --- | --- |
| x | 输入数字。 |
| step | 间隔增量。默认值为 1。 |
| offset | 定义步进间隔的底数。默认值为 0。 |

示例和结果：

示例和结果

| 实例 | 结果 |
| --- | --- |
| `Floor(2.4)` | 返回 2<br><br>In this example, the size of the step is 1 and the base of the step interval is 0.<br><br>The intervals are ...0 &lt;= x &lt;1, 1 &lt;= x &lt; 2, 2&lt;= x &lt;3, 3&lt;= x &lt;4.... |
| `Floor(4.2)` | 返回 4 |
| `Floor(3.88 ,0.1)` | 返回 3.8<br><br>在这个示例中，步进间隔的大小为 0.1，步进间隔的底数为 0。<br><br>间隔为 ... 3.7 &lt;= x &lt; 3.8, 3.8 &lt;= x &lt; 3.9, 3.9 &lt;= x &lt; 4.0... |
| `Floor(3.88 ,5)` | 返回 0 |
| `Floor(1.1 ,1)` | 返回 1 |
| `Floor(1.1 ,1,0.5)` | 返回 0.5<br><br>在这个示例中，步进的大小为 1，步进间隔的偏移为 0.5。意思就是步进间隔的底数为 0.5，不是 0。<br><br>间隔为 ...0.5 &lt;= x &lt;1.5, 1.5 &lt;= x &lt; 2.5, 2.5&lt;= x &lt;3.5,... |

## 了解详情

* [Frac 脚本和图表功能](https://help.qlik.com/zh-CN/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/GeneralNumericFunctions/frac.htm)
* [Ceil 脚本和图表功能](https://help.qlik.com/zh-CN/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/GeneralNumericFunctions/ceil.htm)