num2str in Microsoft Dynamics AX

static void job1(Args _args)
{
    str mileage;
    real mileageNum;

    mileageNum = 100.2543;


// num2str(number to be converted, minimum characters required,

// required number of decimals, decimal separator <1=point, 2=comma>,
// thousand separator <0=none, 1=point, 2=comma, 3=space>)


   mileage = num2str( mileageNum, 0, 2, 1, 0);
   info(strfmt("The car has run %1 miles", mileage));

}

Output:
The above Job will print: The car has run 100.25 miles

Comments