Announcement

Collapse
No announcement yet.

Is there a rounding function ??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there a rounding function ??

    I am trying to round a level calculated to 2 decimal places I have tried the following but does not work. Is it possible ?


    thanks in advance


    Jamie


    val1 = round(2,(High_1+Low_1+Close_1)/3);

  • #2
    Jamie
    You could use the .toFixed() method to define a specific number of decimals ie myVar = val1.toFixed(2)
    Alex

    Comment


    • #3
      Alex

      I added line 155 to this EFS and changed he calcs to show vBal1 instead of vBal but still have three decimal places and lost some levels


      sorry to bre a pain


      Jamie
      Attached Files

      Comment


      • #4
        Jamie
        You cannot use that method as is if you are returning the value to the chart because it converts it to a string which efs does not plot. You need to convert it back to a number.
        Alex

        Comment


        • #5
          OK Thanks Alex


          Jamie

          Comment


          • #6
            You gotta be kidding me!?? Im using a sar calculation and im getting some huge numbers.
            There must be some crafty work around. I'll keep reading.

            Comment


            • #7
              glay
              See the reply I posted to your question in this thread
              Alex

              Comment

              Working...
              X