Concatenate string to numeric

I have a report that gets a field that is numeric from our database. I need to concatenate a dollar sign to it.

Display real disp_minlot()

{

return salesquotationline.pmf_AmountMinLotChg;

}

I just tried

Display real disp_minlot()

{

return “$” + salesquotationline.pmf_AmountMinLotChg;

}

is there a ToString() function I can use to fuse the two?

I am using AX 4.0 and don’t have a lot of x++ experience

I tried

Display str disp_minlot()

{

return “$” + salesquotationline.pmf_AmountMinLotChg.ToString();

}

To no avail

You can’t call methods on primitive data types in X++ - it doesn’t have the magic of boxing like in C#. You can use num2str() instead, or strFmt(): strFmt("$%1", salesquotationline.pmf_AmountMinLotChg).

Nevertheless you should be careful with hard-coded formats - for example, many locales place currency signs behind amounts.