math.floor() 函数
math.floor() 返回小于或等于 x 的最大整数值。
函数类型签名
(x: float) => float
有关更多信息,请参见 Function type signatures。
参数
x
(必填) 要操作的值。
示例
返回小于某个值的最接近整数
import "math"
math.floor(x: 1.22)// 1.0
在 map 中使用 math.floor
import "sampledata"
import "math"
sampledata.float()
|> map(fn: (r) => ({r with _value: math.floor(x: r._value)}))