str.tonumber() - Pine Script Function
str.tonumber()
Section titled “str.tonumber()”Overview
Section titled “Overview”Converts a value represented in string to its “float” equivalent.
Syntax
Section titled “Syntax”str.tonumber(string) → const floatParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| string | const string | String containing the representation of an integer or floating point value. |
Returns
Section titled “Returns”A “float” equivalent of the value in string. If the value is not a properly formed integer or floating point value, the function returns na.