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]);
Announcement
Collapse
No announcement yet.
how do I format debugPrintln output?
Collapse
X
-
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
-
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
Comment