Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  String to int

    Posted 10-29-2018 17:42
    No replies, thread closed.
    Hello

    I'm working in some script. There I need to convert a String value to Integer. 

    Previously I used the Scripter.Set Variable function, to convert an Integer into String, but on the contrary: String to Integer doesn't work. How can I do this?


    Thank you!

    #Integrations

    ------------------------------
    Ricardo Delgado
    Global Networks Solutions S.A.
    ------------------------------


  • 2.  RE: String to int

    Posted 10-30-2018 03:00
    No replies, thread closed.
    Interesting scenario. why do you need to convert this to int - that too in the script?


    Would you be able to give some more background? I am not sure whether script is designed for any arithmetics.

    ------------------------------
    Cheers,
    Sajid Abbas Malek
    Al-Futtaim Technologies - Dubai
    ------------------------------



  • 3.  RE: String to int

    Posted 10-30-2018 07:25
    No replies, thread closed.
    Hello,
    You should be able to use a MathJS function to do this in Scripter. Using a dynamic String variable you could enter the Dynamic Value: as 
    number("5")​
    for instance, which would then convert the string "5" to a number when evaluated in the script at runtime. 

    Please see the following for more information Additional functions to use in dynamic variables - PureCloud Resource Center

    ------------------------------
    Greg Boston
    Genesys - Employees
    ------------------------------