Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger


Monday, September 5, 2011

num2str declaration in Microsoft Dynamics AX

You can also go the other way around by converting the value of a real variable into a string. This operation, however, requires that you know more about how you would like the number represented. Look at the comments in the next code example for an explanation of the parameters.
static void Datatypes_num2str(Args _args)
{
str mileage;
real mileageNum;
;
mileageNum = 388272.23;
// 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,2,0);
print strfmt("The car has run %1 miles", mileage);
pause;
}
The above Job will print: The car has run 388272,23 miles

1 comment:

Archives