fxDreema

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

    Strings, doubles and sums

    Bug Reports
    3
    4
    1890
    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.
    • Abade69
      Abade69 last edited by

      Hello, i found something rather weird when trying to apply consecutive sums:

      Sometimes, they will be shown as infinite decimals (the 7's, 8's, 9's and 1's only). Have not found a way around this yet, somebody got a hint or a way to work around this? I know i can use the Int class, but it won't allow me to use any kind of decimal count.

      0_1521832896391_7.png

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

        try this function:
        https://docs.mql4.com/convert/doubletostr

        0_1521893830496_1f9bf05b-b9cd-42f6-b7a5-e57f325c6406-image.png

        or normalizedouble function

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

        1 Reply Last reply Reply Quote 1
        • fxDreema
          fxDreema last edited by

          Take a look at the documentation about NormalizeDouble - https://www.mql5.com/en/docs/convert/normalizedouble

          What they say is this:

          Please note that when output to Journal using the Print() function, a normalized number may contain a greater number of decimal places than you expect.

          There is no guarantee about these numbers. I tried everything, but still sometimes numbers appear long, even after NormalizeDouble or DoubleToString.

          Abade69 1 Reply Last reply Reply Quote 1
          • Abade69
            Abade69 @fxDreema last edited by

            @fxdreema Thank you sir, let's see if i can find a way around it.

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

            Online Users

            J
            T
            J
            B

            14
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors