PDA

View Full Version : NinjaScript Debug Methods: Print command


OnePutt
11-18-2006, 04:25 PM
Print(Close[0].ToString() + " " + High[0].ToString()) will print the close and high of a set of bars to the output window. Unfortunately, if some prices are even whole numbers and some have a decimal value the columns in the output window will not line up vertically. This is because the low-order zero and decimal point are dropped. Is there a way to format all the pricesso that the columns are correctly aligned? Thanks

NinjaTrader_Dierk
11-18-2006, 10:18 PM
Try Print(Close[0].ToString("0.00") + " " + High[0].ToString("0.00").

Also: Check the Microsoft .NET help docs for the various options to custom format strings.