• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Easy way to round a Double ?

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

    Easy way to round a Double ?

    What is the easiest way to round a double to two DPs for adding to a chart. ie at the moment I have 142.33333 ect and just want 142.33 printed?

    #2
    GKonheiser, you can for example use Math.Round from C# or the dedicated Round2TickSize directly from NT - http://www.ninjatrader.com/support/h...trument_ro.htm
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Who decided on '2' vs 'To'?

      What version on NT did it start in?



      Originally posted by NinjaTrader_Bertrand View Post
      GKonheiser, you can for example use Math.Round from C# or the dedicated Round2TickSize directly from NT - http://www.ninjatrader.com/support/h...trument_ro.htm

      Comment


        #4
        Sorry sledge, not sure what you're trying to say here. Both methods are valid ways to manipulate the outcome as desired.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          Sorry sledge, not sure what you're trying to say here. Both methods are valid ways to manipulate the outcome as desired.
          The usage of 2 in round2ticksize is so incorrect.

          It should have been 'To'.

          Comment


            #6
            Oh I see, thanks. Will note it down in our lists for consideration to change.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ralett, Today, 11:52 AM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_PatrickG  
            Started by rtwave, Yesterday, 07:06 PM
            1 response
            22 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by DTSSTS, Today, 11:27 AM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by siroya, Today, 10:02 AM
            2 responses
            9 views
            0 likes
            Last Post DTSSTS
            by DTSSTS
             
            Started by pjsmith, Today, 10:50 AM
            0 responses
            9 views
            0 likes
            Last Post pjsmith
            by pjsmith
             
            Working...
            X