fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    Converting string variable to double variable value

    Questions & Answers
    2
    2
    397
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kizerage212 last edited by

      So I'm getting a text description (string) from objects on chart. The text is basically EUR: 3.2, for example. But I need to read the 3.2 value, specifically. I assume it needs to be converted to a double variable but nothing is working. I tried custom code too like "pairvalue = StringToDouble(text);" but comment keeps reading "0" for numerical pairvalue variable. Anyone can explain how this can be done?

      jstap 1 Reply Last reply Reply Quote 0
      • jstap
        jstap @kizerage212 last edited by

        @kizerage212 Never used string to value, but using this

        variable=(StringSubstr (variable/constant, 6, 9));

        6, 9 being the start and end in string, double for your variable will give you the digits.

        Learn fxDreema Without the Wait!

        My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

        The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

        Don’t miss out

        Click here➡️ https://mybook.to/fxDreema to get your copy today!

        Enjoy! 😊

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post

        Online Users

        S
        G
        E
        E
        M
        O
        B
        M
        Z
        S
        S
        T
        B

        22
        Online

        146.7k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors