Formatting numbers in NAV

Developer101
Member Posts: 569
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
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
United Kingdom
0
Comments
-
The result you show is, I guess, the result you see in Excel. What happens is that by using the FORMAT command you do change the formatted data that is sent to Excel, but you do not change the way Excel formats decimal values - Excel will just use it's own default formatting.
Are you using the Excel Buffer table (table 370) to do the export? In that case you can use the 'NumFormat' parameter of the AddColumn function to set the format to something like '#,##0.00'Jan Veenendaal0 -
Jan Veenendaal wrote:The result you show is, I guess, the result you see in Excel. What happens is that by using the FORMAT command you do change the formatted data that is sent to Excel, but you do not change the way Excel formats decimal values - Excel will just use it's own default formatting.
Are you using the Excel Buffer table (table 370) to do the export? In that case you can use the 'NumFormat' parameter of the AddColumn function to set the format to something like '#,##0.00'
Yes this solves the problem. Thank you very much.United Kingdom0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions