Skip to content
Algo Trade Analytics Docs

str.tonumber() - Pine Script Function

Converts a value represented in string to its “float” equivalent.

str.tonumber(string) → const float
NameTypeDescription
stringconst stringString containing the representation of an integer or floating point value.

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.