Announcement

Collapse
No announcement yet.

Converting Numbers to Strings

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

  • Converting Numbers to Strings

    I want to be able to convert a price say Close or Open from my chart and be able to save in a text file in the middle of a string .

    NinjaTrader is controlled via strings output to text files so in order to insert a specific price into a string I need to be able to convert a number in a string so I can use concat to assemble the string with my price in the middle of it .

    I have searched though EFS Help and other sources and have not found the function to do this .

    I need to do this for floating point numbers and integers .

    Thanks

  • #2
    try this

    var num = 123.567899;
    var txt = "order is";

    var combined = "my "+txt+" "+num.toFixed(2);

    debugPrintln ("the result of this combo is: "+combined);//this output goes to the formula output window

    no real need to use the concat function

    Comment


    • #3
      It worked . Thanks Steve !

      Comment

      Working...
      X