AX – D365FO – Convert real number to string (num2str)

static void Job7(Args _args) // X++ Job in the AOT, interpreted p-code.
{
    str  moneyString;
    real moneyReal = 12345.68;

    moneyString = num2str
        (
        moneyReal,
        -1, // Minimum number of characters to output into the string. -1 means infinite number of characters

        -1, // Required number of digits to the right of the decimal. -1 means infinite number of digitis

        DecimalSeparator::Dot,    // 1
        ThousandSeparator::Comma  // 2
        );
    info(moneyString);
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s