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

Utilities / Reference

alerta.str.tostring

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

Converts value to string representation. Supports Pine-style format strings and format enums such as format.mintick. Without a format, a number is written with at most ten decimals and no exponent (0.1 + 0.2 gives "0.3"), na as "NaN", a bool as "true" or "false", and an array as its elements in brackets, such as "[1, 2, 3]".

alerta.str.tostring(value, format) → series string

Parameters

NameTypeRequiredDefaultDescription
valueanyYes—Value to format as string.
formatstringNo—Optional Pine format pattern, e.g. "#.00", "+#.00;-#.00", or format.mintick.

Returns

series string

Example

alerta.str.tostring
txt = str.tostring(close, format.mintick)if barstate.islast    label.new(bar_index, high, txt)

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.