TradingView
hapharmonic
Nov 27, 2021 10:35 AM

StringtoNumber 

Description

This library is used to convert Text type numbers are numbers.

Library "StringtoNumber"
str1 = '12340' , vv = numstrToNum(str1)

numstrToNum()


Example

// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org/MPL/2.0/
// © hapharmonic

//@version=5
indicator("My Script")
import hapharmonic/StringtoNumber/1 as CV

TF = '240'
GETTF = CV.numstrToNum(TF)
L = label.new(bar_index, high, '|| numstrToNum :>> || ' + str.tostring(GETTF), style=label.style_label_down,size=size.large)
label.delete(L[1])
More