# int
Convert a number or string to an integer (truncates toward zero).
## Syntax
[int $x]
## Parameters
- `$x` — Number or numeric string
## Examples
[int 3.7] # 3 [int -2.9] # -2 [int "42"] # 42 [int "3.9"] # 3
## Returns
Integer number, or `nil` if a string cannot be parsed.
## See Also
`floor`, `ceil`, `round`, `math/trunc`