Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Rounding UP to the next penny

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

    Rounding UP to the next penny

    I'm been seaching the thread for a way to "always" round a number UP to the next penny, but I cannot find a solution yet? Never thought this would be so hard.

    I've triend to use the .NET Math.Round() function, and the NinjaScript
    Instrument.MasterInstrument.Round2TickSize() function, but both round to the nearest value... which is not what I am trying to do.

    For instance, Math.Round(0.033, 2) givees me 0.03, but I want it to round upto 0.04

    I have also been unable to find anything on the MSDN website.

    Can anyone help me out?

    Thanks.
    -fosch

    #2
    try Math.Ceiling

    Comment


      #3
      Very nice. Thanks bukkan. That will get me to what I need.

      Comment


        #4
        Thank you bukkan for the assistance!

        Just let us know if we can assist with any other questions.
        DexterNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        580 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        335 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        102 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X