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 floatParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
source | series string | Yes | — | Numeric string. |
Returns
series floatExample
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.