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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        152 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        87 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        131 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        127 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        106 views
        0 likes
        Last Post CarlTrading  
        Working...
        X