number
number
Function
Convert the value to a number.
Syntax
number(value)
Parameters
| Parameters | Type | Required | Default value | Description |
|---|---|---|---|---|
| value | Any | No | None | The value to convert. |
Return value
| Type | Description |
|---|---|
| Int/Float/Null | If it can be parsed as an integer, it will return Int; if it can be parsed as a floating point number, it will return Float; if it cannot be converted, it will return Null. |
Example
result = number('42') // Output: 42 print result
Notes
- Returns Null when no parameters are passed.