preloader-matrix

Alfasith

Round the decimals (upper / lower) in AX 2012 / D365

Hi,

static void AlfRound(Args _args)

{

Amount  amount = 5578.59;

info(strfmt(“Amount %1”, amount)); // Printing the original values

info(strfmt(“Round,1  – %1”, round(amount,1))); // This performs standard operation of round and removes the decimal.

info(strfmt(“roundDown,1 – %1”, roundDown(amount,1)));  //Always round by down with ones position, if you make 100 then output will be 5,500.00

info(strfmt(“roundDownDec,1 – %1”, roundDownDec(amount,1))); // Down rounding only the decimal values

info(strfmt(“roundUpDec,1 – %1”, roundUpDec(amount,1))); //Up rounding only the decimal values

info(strfmt(“roundup,1 – %1”, roundup(amount,1))); //Always round by down with ones position, if you make 100 then output will be 5,600.00

info(strfmt(“roundUp(roundUp,1) – %1”, roundUp(roundup(amount,1),1))); // Roud the rounded amount will not make any changes in the rounded amount.

info(strfmt(“decround,1 – %1”, decround(amount,1))); // It performs the standard operation of round in decimal

}

 

 

 

 

 

 

Regards,

One Response

Leave a Reply

Your email address will not be published. Required fields are marked *