Is it possible to convert String into Float or int in PineScript?
We can use str.tostring to convert float to string, but is there a way to go from string to float or int?
I want to try this as a workaround to offset value to the left. As I cant find a way to offset a value to the left, only to the right, I would like to see If I can achieve it by going from Float to String in July/2021 and from String to Float in May/2021.
There is a built-in function for that in Pine v5. See str.tonumber()
It was also already there in Pine v4. See tonumber()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With