Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Rounding Up

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

    Rounding Up

    I am using the following line of code to round down which works without any problems,

    Code:
     ((int)(Close[0]/100))*100
    but I am having a great deal of trouble in attempting to ROUND UP.

    Any help would be greatly appreciated.

    suprsnipes

    #2
    Have you tried yet Math.Ceiling for this task?

    http://msdn.microsoft.com/en-us/libr...ng(VS.80).aspx
    BertrandNinjaTrader Customer Service

    Comment


      #3
      The following code has it working

      Code:
      roundnUP = ((int)Math.Ceiling(Close[0]/100))*100;

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by JTizz, Today, 01:20 PM
      0 responses
      2 views
      0 likes
      Last Post JTizz
      by JTizz
       
      Started by omermirza, Today, 12:39 PM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Jim  
      Started by mballagan, Today, 01:02 PM
      0 responses
      5 views
      0 likes
      Last Post mballagan  
      Started by larkmail, Today, 12:30 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by Danila, Today, 11:08 AM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X