# 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-TW/sense/May2025/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/GeneralNumericFunctions/frac.htm)
* [Ceil - 指令碼與圖表函數](https://help.qlik.com/zh-TW/sense/May2025/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/GeneralNumericFunctions/ceil.htm)