str.tostring
Renders a value as a string. One overload takes a number and one takes a bool. There is no format argument: the call takes the value and nothing else.
str.tostring(series bool source) → series stringstr.tostring(series float source) → series stringstr.tostring(simple bool source) → simple stringstr.tostring(simple float source) → simple string| Parameter | Type | Required | Description |
|---|---|---|---|
source | series bool | yes | the value to render: an int or a float in the numeric overload, a bool in the other |
Returns series string or simple string — The value as text. Where the value is na this returns the two characters NA rather than going absent - the one place in this namespace where na does not propagate.
indicator("The close as text")
alert(str.tostring(close))
plot(close)See also str.contains · str.endswith · str.format_time
Part of the function index.
Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.