Tuesday, November 26, 2019

Round() function in X++

class RoundUpto2decimalPoints
{
    public static void main(Args _args)
    {
    
        real cost = 0.057139;
          
        info(strFmt('%1',round(cost,0.01)));
      
    }
}

In the round function if you want to round up to 2 decimal places then put 0.01. Similarly for rounding up to 3 decimal places we will put 0.001 in the round function.

Thanks,
Uma

No comments:

Post a Comment

Get Enum Id and Enum Value in D365FO using SQL and X++

 Below is the sql get enum id and enum value of a enum in D365 F&O using sql. SELECT   enumidtable . NAME           'Enum Name' ...