February 04, 2013

How to Round Up and Round Down Numbers In AX

To round number in AX, we can use 2 method. If we wanna round up, we can use RoundUp(real value, real unit) function and we can use RoundDown(real value, real unit) function if we wanna round down numbers. For example, we can see the source code of a job below :

static void Rounding(Args _args)
{
    real    temp, roundingUp, roundingDown;
    ;
    temp = 3000 / 7;
    roundingUp = roundUp(temp, 1);
    roundingDown = roundDown(temp, 1);
    info(strFmt("Origin : %1 RoundingUp : %2 RoundingDown : %3", temp, RoundingUp, roundingDown));
}


The result is like a picture below :


3 comments:

  • Anonymous says:
    9/08/2014

    Nice blog here! Also your site loads up very fast!

    What host are you using? Can I get your affiliate link to your host?
    I wish my website loaded up as fast as yours lol

    My site :: duplex for rent minneapolis

  • Unknown says:
    2/26/2019

    Hi all,

    can you tell me how rounding the amount in sales order eg.,7575.45345
    i want same amount in amount column.

  • Unknown says:
    2/26/2019

    i don't want to rounding the amount..

Post a Comment