fxDreema

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

    Add values of string and double variables?

    Questions & Answers
    2
    2
    1082
    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.
    • B
      BlueMoon last edited by

      I have the following 2 variables. How do I add value of them to generate another string variable?

      Double abc 3.4467
      Srting xyz "hello"

      I want to add the xyz + abc to produce a string variable with value "hello 3.4467"

      1 Reply Last reply Reply Quote 0
      • M
        miro1360 last edited by miro1360

        lets say your third variable is
        String result
        use custom code block and "add" them together:
        result = hello + (string)abc;

        (string)abc means, that abc you want convert to string from double ...

        if you want space between, than this:
        result = hello + " " + (string)abc;

        if you want to add something own:
        result = hello + " " + (string)abc + " myText";

        if you need precision from double number, do this:
        result = hello + DoubleToStr(abc, 4);
        where number 4 means how much digits you need after decimal ...

        Between trading and gambling is a very small gap, be careful.

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

        Online Users

        E
        H
        R
        A

        11
        Online

        146.7k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors