Skip to content
AlertaChartAlertaScript / docs
AlertaScript / alerta.str.tonumber
On this pageSignatureParametersReturnsExample

Utilities / Reference

alerta.str.tonumber

TradingView-compatible spelling: str.tonumber, runs without warnings

Converts a plain decimal number written as text into a float: digits, an optional sign at the start and at most one decimal point ("1234.50", "-12.5", "+3", ".5"). Anything else is na — an empty string, surrounding spaces, thousands separators ("1,234"), currency signs, exponents ("1e3") and hexadecimal ("0x10").

alerta.str.tonumber(source) → series float

Parameters

NameTypeRequiredDefaultDescription
sourceseries stringYes—Numeric string.

Returns

series float

Example

alerta.str.tonumber
v = str.tonumber("123.45")plot(v, { pane: "oscillator" })

Names and aliases

Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.

AlertaScript

No results found.

Search by name, alias, or keyword.