Announcement

Collapse
No announcement yet.

how do I format debugPrintln output?

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

  • how do I format debugPrintln output?

    Please tell me how to format debugPrintln number output. Promise I am not just dumping this on you guys without first consulting the Knowledge Base, a Java manual and a C programming manual. I think it must be something like debugPrintln("my_variable=" + [email protected]);

  • #2
    You can use the toFixed() method to control how many digits after the decimal place are displayed.

    For example my_variable.toFixed(4) will display 4 digits after the decimal place. It doesn't place any restrictions on how many digits are displayed to the left of the decimal though.

    If you are trying to align numbers in columns you will probably have to write your own function to do that.

    Steve

    Comment


    • #3
      jcm21
      To add to Steve's reply if the number you are formatting is a price and you want to display it in the Formula Output Window in the same format it appears on the chart then you could use the formatPriceNumber() function (see the link for the description and syntax of the function)
      Alex

      Comment


      • #4
        Thanks Steve and Alex

        Thanks Steve and Alex,

        Worked great. That was just what I was looking for.

        Comment

        Working...
        X