How to remove ThousandSeparator in StrFmt AX 2012 R3.

Hello,

I have a real and i want to format it :

real realNum = 164740.129456;

str strValue= num2str(realNum,-1,2,DecimalSeparator::Dot,ThousandSeparator::None);

info(strValue); // Output 164740.13
info(strFmt("%1",realNum)); // Output 164,740.13

i need output value like this 164740.13 in strFmt with real datatype without ThousandSeparator.

Please help me, thanks in advance.

strFmt() doesn’t allow you to specify formatting. If you don’t want the default formatting, you indeed need to convert the number to string by yourself and not simply throwing a number to strFmt().

Note that num2str() isn’t your only option. For example, I like using System.String::Format() in complex cases.

Thank you Martin.