Formatting numbers in NAV

Hello,

I am working on a report which gets exported to Excel. I am struggling the the formatting the numbers to the required format.
The required format is 2 decimal places after a number and use of , for the numbers above 1000.

I am using this in my code. FORMAT(Amount,0,’<Precision,2:2><Standard Format,3>’)

When the Amount is >= 1000, then the required format is achieved e.g; if number is 1200 the result would be 1,200.00

But when the Amount is < 1000 (less than thousand) then result does not change to the required format. For example if number is 732 then this should need to be changed to 732.00 but its not happening. The result stays 732

Please help.

Thanks,

Regards, Imran

Hi,

Have you tried something like below when exporting to excel from excel buffer?:

ExcelBuf.AddColumn(FORMAT(ROUND(T27G.“Last Direct Cost”,0.01,’=’)),FALSE,’’,FALSE,FALSE,FALSE,’#,##0.00’,
DefFontColourD,DefFontSizeD,DefBorderLineStyleD);

Neil

Neil thank you very much this solves my problem. :slight_smile: