toint()

將輸入轉換成整數值, (帶正負號的 32 位) 數位表示。

注意

可能的話,請改用 int 常值

語法

toint(value)

深入瞭解 語法慣例

參數

名稱 類型 必要 Description
value 純量 (scalar) ✔️ 要轉換成 整數的值。

傳回

如果轉換成功,結果將會是整數。 否則,結果將為 null

範例

print toint("123") == 123

輸出

print_0
true