num2Str Function
Dynamics AX 2009
Converts a real number to a string.
str num2Str(
real number,
int character,
int decimals,
int separator1,
int separator2)
For the decimals parameter, the maximum value is 16. If a larger number is used, this method instead obtains a value for the decimals parameter from the local computer. In both cases rounding does occur.
Possible enumeration values for the separator1 parameter are:
-
1 – point (.)
-
2 – comma (,)
Possible values for the separator2 parameter are:
-
0 – no thousands separator
-
1 – point (.)
-
2 – comma (,)
-
3 – space ( )
In the following code example, the first call to the num2str method provides 16 for the decimals parameter, and the second provides 17.
static void Job_Num2Str(Args _args)
{
real realNum = 0.1294567890123456777; // 19 decimals places.
;
info(Num2Str(realNum,0,16,1,3)); // 16 decimals
info(Num2Str(realNum,0,17,1,3)); // 17 decimals
}
Community Additions
ADD
Show: